Makefile for easy install, rel_2_2 opac templates
authorJeff Godin <jgodin@tadl.org>
Thu, 19 Jul 2012 19:56:15 +0000 (15:56 -0400)
committerJeff Godin <jgodin@tadl.org>
Thu, 19 Jul 2012 19:56:15 +0000 (15:56 -0400)
Testing and proof of concept - this is a Makefile to run a
simple copy of templates in the working dir to the proper
destination in /openils/var/templates_tadlskin

Also, a copy of the current rel_2_2 opac templates, which
we will apply our changes to.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
96 files changed:
Makefile [new file with mode: 0644]
templates_tadlskin/opac/advanced.tt2 [new file with mode: 0644]
templates_tadlskin/opac/cnbrowse.tt2 [new file with mode: 0644]
templates_tadlskin/opac/home.tt2 [new file with mode: 0644]
templates_tadlskin/opac/login.tt2 [new file with mode: 0644]
templates_tadlskin/opac/mylist.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/circ_history.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/circ_history/export.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/circs.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/hold_history.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/holds.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/holds/edit.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/list/print.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/lists.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/main.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/main_pay.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/main_pay_init.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/main_payment_form.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/main_payments.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/prefs.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/prefs_notify.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/prefs_settings.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/receipt_email.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/receipt_print.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/update_email.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/update_password.tt2 [new file with mode: 0644]
templates_tadlskin/opac/myopac/update_username.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/advanced/expert.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/advanced/global_row.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/advanced/numeric.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/advanced/search.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/anon_list.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/base.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/chilifresh.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/coded_value_selector.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/config.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/filtersort.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/footer.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/goog_analytics.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/header.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/hold_error_messages.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/hold_status.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/homesearch.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/js.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/login/form.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/login/help.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/login/password_hint.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/misc_util.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/myopac/base.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/myopac/main_base.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/myopac/main_refund_policy.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/myopac/prefs_base.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/myopac/prefs_hints.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/org_selector.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/place_hold.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/place_hold_result.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/pref_lib_display.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/preserve_params.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/qtype_selector.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/authors.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/awards.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/body.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/cnbrowse.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/copy_counts.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/copy_table.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/extras.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/issues-db.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/issues-mfhd.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/issues.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/navigation.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/refworks.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/series.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/subjects.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/summary.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/record/summaryplus.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/result/copy_counts.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/result/facets.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/result/lowhits.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/result/lowhits_purchase.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/result/paginate.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/result/table.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/searchbar.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/sms_carrier_selector.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/sms_number_textbox.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/staff_saved_searches.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/tips.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/topnav.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/topnav_links.tt2 [new file with mode: 0644]
templates_tadlskin/opac/parts/topnav_logo.tt2 [new file with mode: 0644]
templates_tadlskin/opac/password_reset.tt2 [new file with mode: 0644]
templates_tadlskin/opac/place_hold.tt2 [new file with mode: 0644]
templates_tadlskin/opac/record.tt2 [new file with mode: 0644]
templates_tadlskin/opac/record/email.tt2 [new file with mode: 0644]
templates_tadlskin/opac/record/print.tt2 [new file with mode: 0644]
templates_tadlskin/opac/results.tt2 [new file with mode: 0644]
templates_tadlskin/opac/sms_cn.tt2 [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..569c1a8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+install:
+       cp -a templates_tadlskin /openils/var
diff --git a/templates_tadlskin/opac/advanced.tt2 b/templates_tadlskin/opac/advanced.tt2
new file mode 100644 (file)
index 0000000..220c56f
--- /dev/null
@@ -0,0 +1,43 @@
+[%- PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Advanced Search");
+    pane = CGI.param("pane") || "advanced";
+    loc = ctx.search_ou;
+-%]
+    <div id="search-wrapper">
+        <div id="search-box">
+            <span class="search_catalog_lbl">[% l('Search the Catalog') %]</span>
+            <a href="[% mkurl(ctx.opac_root _ '/home') %]"
+                id="home_adv_search_link"><span
+                class="adv_search_font">[%l('Basic Search')%]</span></a>
+        </div>
+        <div id="adv_search_parent">
+            <div id="adv_search_tabs">
+                <a href="[% mkurl('', {pane => 'advanced'}) %]"
+                    [% IF pane == 'advanced' %]class="on" [% END %]
+                    id="adv_search">[% l('Advanced Search') %]</a>
+                <a href="[% mkurl('', {pane => 'numeric'}) %]"
+                    [% IF pane == 'numeric' %]class="on" [% END %]
+                    id="num_search">[% l('Numeric Search') %]</a>
+                <a href="[% mkurl('', {pane => 'expert'}) %]"
+                    [% IF pane == 'expert' %]class="on" [% END %]
+                    id="expert_search">[% l('Expert Search') %]</a>
+            </div>
+        </div>
+    </div>
+    <div id="content-wrapper">
+        <div id="main-content">
+            <div class="advanced_div">
+            [% IF pane == 'advanced' %]
+            [% INCLUDE "opac/parts/advanced/search.tt2" %]
+            [% ELSIF pane == 'numeric' %]
+            [% INCLUDE "opac/parts/advanced/numeric.tt2" %]
+            [% ELSIF pane == 'expert' %]
+            [% INCLUDE "opac/parts/advanced/expert.tt2" %]
+            [% END %]
+            </div>
+            <div class="common-full-pad"></div>        
+        </div>
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/cnbrowse.tt2 b/templates_tadlskin/opac/cnbrowse.tt2
new file mode 100644 (file)
index 0000000..a290b64
--- /dev/null
@@ -0,0 +1,20 @@
+[%  # This is the stand-alone call-number browser.  This mainly wraps around
+    # the same guts as the "shelf browser" part of a record results page.
+
+    PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Call Number Browse"); %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <div id="content-wrapper">
+        <div id="main-content">
+            <div class="cnbrowse_div">
+                [% INCLUDE "opac/parts/record/cnbrowse.tt2" %]
+            </div>
+            <div class="common-full-pad"></div>        
+        </div>
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/home.tt2 b/templates_tadlskin/opac/home.tt2
new file mode 100644 (file)
index 0000000..19dfc58
--- /dev/null
@@ -0,0 +1,15 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Home") %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <div id="content-wrapper">
+        <div id="main-content-home">
+            <div class="common-full-pad"></div>
+            [% INCLUDE "opac/parts/homesearch.tt2" %]
+            <div class="common-full-pad"></div>        
+        </div>
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/login.tt2 b/templates_tadlskin/opac/login.tt2
new file mode 100644 (file)
index 0000000..29994ad
--- /dev/null
@@ -0,0 +1,26 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Account Login") %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <div id="content-wrapper">
+        <div id="main-content">
+            [% INCLUDE "opac/parts/login/form.tt2" %]
+            <div class="clear-both very-big-height"></div>     
+            <script type="text/javascript">
+                /* Note: when common browsers support HTML5 "autofocus", we can remove this */
+                var _onload = window.onload;
+                window.onload = function() {
+                    try {
+                        document.getElementById("username_field").focus();
+                        if (_onload) _onload();
+                    } catch (E) {
+                        void(0);
+                    }
+                };
+            </script>
+        </div>
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/mylist.tt2 b/templates_tadlskin/opac/mylist.tt2
new file mode 100644 (file)
index 0000000..b77eeae
--- /dev/null
@@ -0,0 +1,19 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Record Detail") %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <div id="content-wrapper">
+        <div id="main-content">
+            [%  IF ctx.mylist.size;
+                    INCLUDE "opac/parts/anon_list.tt2";
+                ELSE %]
+                <div class="opac-auto-171 opac-auto-097">[% l("You have not created a list yet."); %]</div>
+                [% END %]
+            <div class="common-full-pad"></div>        
+        </div>
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/circ_history.tt2 b/templates_tadlskin/opac/myopac/circ_history.tt2
new file mode 100644 (file)
index 0000000..4e8c861
--- /dev/null
@@ -0,0 +1,109 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "circs"
+    limit = ctx.circ_history_limit;
+    offset = ctx.circ_history_offset;
+%]
+
+<div style="padding:0px;">
+    
+    <div id="acct_checked_tabs">
+        <div class="align">
+            <a href='[% mkurl('circs') %]'>[% l("Current Items Checked Out") %]</a>
+        </div>
+        <div class="align selected">
+            <a href="#">[% l("Check Out History") %]</a>
+        </div>
+    </div>
+
+    <div class="header_middle">
+        <span class="float-left">[% l('Previously Checked Out Items') %]</span>
+        <span class='float-left' style='padding-left: 10px;'>
+            <a href='[% mkurl('circ_history', {limit => limit, offset => (offset - limit)}) %]'
+                [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
+            [%# TODO: get total to prevent paging off then end of the list.. %]
+            <a href='[% mkurl('circ_history', {limit => limit, offset => (offset + limit)}) %]'
+               [% IF ctx.circs.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
+        </span>
+        <span class="float-left">
+            <form action="[% mkurl(ctx.opac_root _ '/myopac/circ_history/export') %]" method="POST">
+                <div>
+                    [%- INCLUDE "opac/parts/preserve_params.tt2" %]
+                    <input type="hidden" name="filename" value="[% l('circ_history.csv') %]"/> 
+                    <button type="submit">[% l('Download CSV') %]</button>
+                </div>
+            </form>
+        </span>
+    </div>
+    <div class="clear-both"></div>
+
+    [% IF ctx.circs.size < 1 %]
+    <div class="warning_box">
+        <big><strong>[% l('There are no items in your circulation history.') %]</strong></big>
+    </div>
+    [% ELSE %]
+
+    <div id='checked_main'>
+        <table style='border-collapse:collapse;'>
+            <thead id="acct_checked_main_header">
+                <tr>
+                    <td width="32%" style="padding-left:5px;">
+                        <span title="Click to sort" class='pointer'>[% l('Title') %]</span> /
+                        <span title="Click to sort" class='pointer'>[% l('Author') %]</span>
+                    </td>
+                    <td width="10%" style="padding-left:5px;">
+                        <span title="Click to sort" class='pointer'>[% l('Checkout Date') %]</span>
+                    </td>
+                    <td width="10%" style="padding-left:5px;">
+                        <span title="Click to sort" class='pointer'>[% l('Due Date') %]</span>
+                    </td>
+                    <td width="10%" style="padding-left:5px;">
+                        <span title="Click to sort" class='pointer'>[% l('Date Returned') %]</span>
+                    </td>
+                    <td width="16%">
+                        <span title="Click to sort" class='pointer'>[% l('Barcode') %]</span>
+                    </td>
+                    <td width="22%">
+                        <span title="Click to sort" class='pointer'>[% l('Call Number') %]</span>
+                    </td>
+                </tr>
+            </thead>
+            <tbody>
+                [% FOR circ IN ctx.circs;
+                    attrs = {marc_xml => circ.marc_xml};
+                    PROCESS get_marc_attrs args=attrs; %]
+                    <tr>
+                        <td style="padding-left:5px;padding-bottom:10px;">
+                            <a href="[% mkurl(ctx.opac_root _ '/record/' _ circ.circ.target_copy.call_number.record.id) %]" 
+                                name="[% l('Catalog record') %]">[% attrs.title | html %]</a>
+                            [% IF attrs.author %] /
+                            <a href="[% mkurl(ctx.opac_root _ '/results',
+                                {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
+                            )%]">[% attrs.author | html %]</a>
+                            [% END %]
+                        </td>
+                        <td style="padding-left:5px;">
+                            [% date.format(ctx.parse_datetime(circ.circ.xact_start),DATE_FORMAT); %]
+                        </td>
+                        <td style="padding-left:5px;">
+                            [% date.format(ctx.parse_datetime(circ.circ.due_date),DATE_FORMAT); %]
+                        </td>
+                        <td style="padding-left:5px;">
+                            [% 
+                                IF circ.circ.checkin_time; 
+                                    date.format(ctx.parse_datetime(circ.circ.checkin_time),DATE_FORMAT); 
+                                ELSE; %]
+                                <span style='color:blue;'>*</span><!-- meh -->
+                            [% END; %]
+                        </td>
+                        <td>[% circ.circ.target_copy.barcode | html %]</td>
+                        <td>[% circ.circ.target_copy.call_number.label | html %]</td>
+                    </tr>
+                [% END %]
+            </tbody>
+        </table>
+    </div>
+    [% END %]
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/circ_history/export.tt2 b/templates_tadlskin/opac/myopac/circ_history/export.tt2
new file mode 100644 (file)
index 0000000..fa3988f
--- /dev/null
@@ -0,0 +1 @@
+[%- ctx.csv.template_output.data -%]
diff --git a/templates_tadlskin/opac/myopac/circs.tt2 b/templates_tadlskin/opac/myopac/circs.tt2
new file mode 100644 (file)
index 0000000..bf3ab0e
--- /dev/null
@@ -0,0 +1,172 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "circs"  %]
+<div id='myopac_checked_div'>
+
+    <div id="acct_checked_tabs">
+        <div class="align selected">
+            <a href="#">[% l("Current Items Checked Out") %]</a>
+        </div>
+        <div class="align">
+            <a href="[% mkurl('circ_history') %]">[% l("Check Out History") %]</a>
+        </div>
+    </div>
+
+    <div class="header_middle">
+        <span class="float-left">[% l('Current Items Checked Out') %]</span>
+        <span class="float-right">
+            <a class="hide_me" href="#">[% l('Export List') %]</a>
+        </span>
+    </div>
+    <div class="clear-both"></div>
+    [% IF ctx.circs.size < 1 %]
+    <div class="warning_box">
+        <big><strong>[% l('You have no items checked out.') %]</strong></big>
+    </div>
+    [% ELSE %]
+    [% IF ctx.success_renewals %]
+    <div class="renew-summary">
+        [% l("Successfully renewed [_1] item(s)", ctx.success_renewals) %]
+    </div>
+    [% END %]
+    [% IF ctx.failed_renewals %]
+    <div class="renew-summary alert">
+        [% l("Failed to renew [_1] item(s)", ctx.failed_renewals) %]
+    </div>
+    [% END %]
+    <div id='checked_main'>
+        <form method="POST" id="circ-form"
+            onsubmit="return confirm('[% l("Are you sure you wish to renew the selected item(s)?") %]');">
+        <table cellpadding='0' cellspacing='0' class="item_list_padding">
+            <tr>
+                <td>
+                    <select name="action">
+                        <option value="renew">[% l('Renew Selected Titles') %]</option>
+                    </select>
+                </td>
+                <td style="padding-left:9px;">
+                    <input type="submit"
+                        value="[% l('Go') %]"
+                        alt="[% l('Go') %]" title="[% l('Go') %]"
+                        class="opac-button" />
+                </td>
+                <td style="padding-left:5px;">
+                    <a href="#"><img alt="Renewing Help"
+                        src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
+                </td>
+            </tr>
+        </table>
+        <table id="acct_checked_main_header" cellpadding='0' cellspacing='0'
+            border='0'>
+            <tr>
+                <td width="1%" style="padding-left:10px;">
+                    <input type="checkbox" id="check_all_checked"
+                        onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'circ' && !inputs[i].disabled) inputs[i].checked = this.checked;}"
+                    />
+                </td>
+                <td width="40%" style="padding-left:5px;">
+                    <span title="Click to sort" class='pointer'>
+                        Title
+                    </span> /
+                    <span title="Click to sort" class='pointer'>
+                        Author
+                    </span>
+                </td>
+                <td width="8%" style="padding-right:5px;" align="center">
+                    <span title="Click to sort" class='pointer'>Renews<br />Left
+                    </span>
+                </td>
+                <td width="13%" style="padding-left:5px;">
+                    <span title="Click to sort" class='pointer'>Due Date</span>
+                </td>
+                <td width="16%">
+                    <span title="Click to sort" class='pointer'>barcode</span>
+                </td>
+                <td width="22%">
+                    <span title="Click to sort" class='pointer'>call number</span>
+                </td>
+            </tr>
+        </table>
+   
+        <div id="checked_temp_parent">
+            <div id="acct_checked_temp">
+                <table cellpadding='0' cellspacing='0' border='0'
+                    style="margin-top:5px;">
+                    [% FOR circ IN ctx.circs;
+                        attrs = {marc_xml => circ.marc_xml};
+                        PROCESS get_marc_attrs args=attrs; %]
+                    <tr>
+                        <td width="1%" style="padding-left:10px;" valign="top">
+                            <input type="checkbox" name="circ"
+                                [% IF circ.circ.renewal_remaining < 1 %] disabled="disabled" [% END %]
+                                value="[% circ.circ.id %]" />
+                        </td>
+                        <td width="40%"
+                            style="padding-left:5px;padding-bottom:10px;"
+                            name="author">
+                            <a href="[% mkurl(ctx.opac_root _ '/record/' _ 
+                                circ.circ.target_copy.call_number.record.id) %]"
+                                name="[% l('Catalog record') %]">[% attrs.title | html %]</a>
+                            [% IF attrs.author %] /
+                            <a href="[% mkurl(ctx.opac_root _ '/results',
+                                {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
+                            ) %]">[% attrs.author | html %]</a>
+                            [% END %]
+                        </td>
+                        <td width="8%" name="renewals" align="center">
+                            [% circ.circ.renewal_remaining %]
+                        </td>
+                        [%
+                            due_date = ctx.parse_datetime(circ.circ.due_date);
+                            due_class = (date.now > date.format(due_date, '%s')) ? 'error' : '';
+                        %]
+                        <td width="13%" style="padding-left:5px;" name="due_date" class='[% due_class %]'>
+                            [% date.format(due_date, DATE_FORMAT) %]
+                        </td>
+                        <td width="16%" name="barcode">
+                            [% circ.circ.target_copy.barcode | html %]
+                        </td>
+                        <td width="22%" name="call_number">
+                            [% circ.circ.target_copy.call_number.label | html %]
+                        </td>
+                    </tr>
+                    [%  IF circ.renewal_response AND
+                            circ.renewal_response.textcode != 'SUCCESS' %]
+                    <tr>
+                        <td colspan="6">[%# XXX colspan="0" does not work in IE %]
+                            <span class="failure-text" title="[% circ.renewal_response.textcode | html %] / [% circ.renewal_response.payload.fail_part | html %]">
+                                [% (circ.renewal_response.desc || circ.renewal_response.payload.fail_part || circ.renewal_response.textcode) | html %]
+                            </span>
+                        </td>
+                    </tr>
+                    [%  END;
+                    END %]
+                </table>
+            </div>
+        </div>
+        </form>
+    </div>
+    [% END %]
+    <div id='non_cat_circs_div' class='hide_me'>
+        <br/>
+        <div style='text-align: center'><b>[% l("Other Circulations") %]</b></div>
+        <table class='data_grid' width='100%'>
+            <thead>
+                <tr>
+                    <td>[% l("Circulating Library") %]</td>
+                    <td>[% l("Circulation Type") %]</td>
+                    <td>[% l("Please return by ...") %]</td>
+                </tr>
+            </thead>
+            <tbody id='non_cat_circs_tbody'>
+                <tr id='non_cat_circs_row'>
+                    <td name='circ_lib'/>
+                    <td name='item_type'/>
+                    <td name='circ_time'/>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/hold_history.tt2 b/templates_tadlskin/opac/myopac/hold_history.tt2
new file mode 100644 (file)
index 0000000..bc3cc6c
--- /dev/null
@@ -0,0 +1,110 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    PROCESS "opac/parts/hold_status.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "holds";
+    limit = ctx.hold_history_limit;
+    offset = ctx.hold_history_offset;
+%]
+
+<div id='myopac_holds_div'>
+
+    <div id="acct_holds_tabs">
+        <div class="align">
+            <a href='[% mkurl('holds') %]'>[% l("Items on Hold") %]</a>
+        </div>
+        <div class="align selected">
+            <a href="#">[% l("Holds History") %]</a>
+        </div>
+    </div>
+
+    <div class="header_middle">
+        <span style="float:left;">[% l("Previously Held Items") %]</span>
+        <span class='float-left' style='padding-left: 10px;'>
+            <a href='[% mkurl(hold_history, {limit => limit,offset => (offset - limit)}) %]'
+                [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
+            [%# TODO: get total to prevent paging off then end of the list.. %]
+            <a href='[% mkurl(hold_history, {limit => limit, offset => (offset + limit)}) %]'
+               [% IF ctx.holds.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
+        </span>
+        <span style="float:right;">
+            <a class="hide_me" href="#">Export List</a>
+        </span>
+    </div>
+    <div class="clear-both"></div>
+
+    <div id='holds_main'>
+        [% IF ctx.holds.size < 1 %]
+        <div class="warning_box">
+            <big><strong>[% l('No holds found.') %]</strong></big>
+        </div>
+        [% ELSE %]
+        <table style='border-collapse:collapse; width: 100%;'>
+            <thead id='acct_holds_main_header'>
+                <tr>
+                    <td width="138"><span>[% l('Title') %]</span></td>
+                    <td width="123"><span>[% l('Author') %]</span></td>
+                    <td width="64"> <span>[% l('Format') %]</span></td>
+                    <td width="136"><span>[% l('Pickup Location') %]</span> </td>
+                    <td width="104">[% l('Active On') %]</td>
+                    <td width="95">[% l('Active') %]</td>
+                    <td width="106">[% l('Date Fulfilled') %]</td>
+                    <td width="172"><span>[% l('Status') %]</span></td>
+                </tr>
+            </thead>
+            <tbody>
+                [% FOR hold IN ctx.holds;
+                    attrs = {marc_xml => hold.marc_xml};
+                    PROCESS get_marc_attrs args=attrs;
+                    ahr = hold.hold.hold %]
+
+                <tr id="acct_holds_temp" name="acct_holds_temp" class="acct_holds_temp">
+
+                    <td width="138">
+                        <div style="margin-top:10px;margin-bottom:10px;">
+                            <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% attrs.title | html %]</a>
+                        </div>
+                    </td>
+                    <td width="123">
+                        <div style="margin-top:10px;margin-bottom:10px;">
+                            <a href="[% mkurl(ctx.opac_root _ '/results',
+                                {qtype => author, query => attrs.author.replace('[,\.:;]', '')}
+                            ) %]">[% attrs.author | html %]</a>
+                        </div>
+                    </td>
+                    <td width="64">
+                        <div style="width:26px;height:23px;margin-top:6px;margin-bottom:6px;">
+                            [% IF attrs.format_icon %]
+                            <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
+                            [% END %]
+                        </div>
+                    </td>
+                    <td width="136">
+                        [% ctx.get_aou(ahr.pickup_lib).name | html %]
+                    </td>
+                    <td width="104">
+                        [% IF ahr.frozen == 't' AND ahr.thaw_date;
+                            date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td width="95">
+                        [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
+                    </td>
+                    <td width="106">
+                        [% IF ahr.fulfillment_time;
+                            date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td width="110">
+                        <div name="acct_holds_status"
+                            style="margin-top:10px;margin-bottom:10px;">
+                            [% PROCESS get_hold_status hold=hold; %]
+                        </div>
+                    </td>
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+        [% END %]
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/holds.tt2 b/templates_tadlskin/opac/myopac/holds.tt2
new file mode 100644 (file)
index 0000000..1a6f209
--- /dev/null
@@ -0,0 +1,231 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    PROCESS "opac/parts/hold_status.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "holds"  %]
+<div id='myopac_holds_div'>
+
+    <div id="acct_holds_tabs">
+        <div class="align selected">
+            <a href='#'>[% l("Items on Hold") %]</a>
+        </div>
+        <div class="align">
+            <a href='[% mkurl('hold_history') %]'>[% l("Holds History") %]</a>
+        </div>
+    </div>
+
+    <div class="header_middle">
+        <span id="acct_holds_header" style="float:left;">
+            [%  IF CGI.param("available");
+                    l("Items Ready for Pickup");
+                ELSE;
+                    l("Current Items on Hold");
+                END
+            %]
+        </span>
+        <span style="float:right;">
+            <a class="hide_me" href="#">Export List</a>
+        </span>
+    </div>
+    <div class="clear-both"></div>
+    <div id='holds_main'>
+        <form method="POST">
+        <table cellpadding='0' cellspacing='0' class="opac-auto-097">
+            <tr>
+                <td width="1">
+                    <select name="action" id="acct_holds_actions">
+                        <option id='myopac_holds_actions_none' value=''>
+                        -- [% l("Actions for selected holds") %] --
+                        </option>
+                        <option value='suspend'>[% l("Suspend") %]</option>
+                        <option value='activate'>[% l("Activate") %]</option>
+                        <!-- XXX maybe later <option value='thaw_date'>[% l("Set Active Date") %]</option> -->
+                        <option value='cancel'>[% l("Cancel") %]</option>
+                    </select>
+                </td>
+                <td width="1" style="padding-left:9px;">
+                    <input type="submit" value="[% l('Go') %]"
+                        alt="[% l('Go') %]" title="[% l('Go') %]"
+                        class="opac-button" />
+                </td>
+                <td width="1" style="padding-left:5px;">
+                    <a href="#"><img
+                        alt="Holds Help"
+                        src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
+                </td>
+                <td style="padding-left:5px;" class='error'>
+                    [%  IF ctx.hold_suspend_post_capture;
+                            l('One or more holds could not be suspended because<br/>the item is at (or en route to) the pickup library.');
+                        END;
+                    %]
+                </td>
+                <td align="right">
+                    [% l("Show") %] &nbsp; &nbsp;
+                    [% IF CGI.param("available") %]
+                    <a href="[% mkurl('holds', {}, ['available']) %]">[% l('all') %]</a> |
+                    <strong>[% l("only available") %]</strong>
+                    [% ELSE %]
+                    <strong>[% l("all") %]</strong> |
+                    <a href="[% mkurl('holds', {available => 1}) %]">[% l("only available") %]</a>
+                    [% END %] &nbsp; &nbsp;
+                    [% l("holds") %]
+                    <select class="hide_me" id="holds_sort">
+                        <option value="">-- Sort By --</option>
+                        <option value="title">Title</option>
+                        <option value="pickup">PickUp Location</option>
+                        <option value="status">Status</option>
+                    </select>
+                </td>
+            </tr>
+        </table>
+        [% IF ctx.holds.size < 1 %]
+        <div class="warning_box">
+            <big><strong>[% l('No holds found.') %]</strong></big>
+        </div>
+        [% ELSE %]
+        <table id="acct_holds_main_header" cellpadding='0' cellspacing='0'
+            border='0' width="100%">
+            <tr>
+                <td width="36" align="center">
+                    <input type="checkbox" onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'hold_id' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
+                </td>
+                <td width="138">
+                    <span title="Click to sort"
+                        style="cursor:pointer;">
+                        Title
+                    </span>
+                </td>
+                <td width="123">
+                    <span title="Click to sort" style="cursor:pointer;">Author</span>
+                </td>
+                <td width="64">
+                    <span title="Click to sort"
+                        style="cursor:pointer;">Format</span>
+                </td>
+                <td width="136">
+                    <span title="Click to sort"
+                        style="cursor:pointer;">Pickup Location</span>
+                </td>
+                <td width="104">Activate</td>
+                <td width="106">Cancel if not<br />filled by</td>
+                <td width="95">Active</td>
+                <td width="172">
+                    <span title="Click to sort"
+                        style="cursor:pointer;">Status</span>
+                </td>
+            </tr>
+        </table>
+        <div class="hide_me">
+            <select id="hold_pickup_lib_temp" name="hold_pickup_lib_sel"
+                class="hide_me" style="width:125px;height:21px;"></select>
+        </div>
+
+        <table cellpadding='0' cellspacing='0' border='0' width="100%">
+            <tbody id="holds_temp_parent">
+                [% FOR hold IN ctx.holds;
+                    attrs = {marc_xml => hold.marc_xml};
+                    PROCESS get_marc_attrs args=attrs;
+                    ahr = hold.hold.hold %]
+                <tr id="acct_holds_temp" name="acct_holds_temp"
+                    class="acct_holds_temp[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
+                    <td width="36" align="center" style="text-align:center;">
+                        <input type="checkbox" name="hold_id" value="[% ahr.id %]" />
+                    </td>
+                    <td width="138">
+                        <div style="margin-top:10px;margin-bottom:10px;">
+                            [% 
+                                title = attrs.title;
+                                IF ahr.hold_type == 'P';
+                                    title = l('[_1] ([_2])', title, hold.hold.part.label);
+                                END;
+                            %]
+                            <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% title | html %]</a>
+                        </div>
+                    </td>
+                    <td width="123">
+                        <div style="margin-top:10px;margin-bottom:10px;">
+                            <a href="[% mkurl(ctx.opac_root _ '/results',
+                                {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
+                            ) %]">[% attrs.author | html %]</a>
+                        </div>
+                    </td>
+                    <td width="64">
+                        <div style="width:26px;height:23px;margin-top:6px;margin-bottom:6px;">
+                            [% IF attrs.format_icon %]
+                            <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
+                            [% END %]
+                        </div>
+                    </td>
+                    <td width="136">
+                        [% ctx.get_aou(ahr.pickup_lib).name | html %]
+                    </td>
+                    <td width="104">
+                        <!-- <input
+                            title="Enter a date (e.g. 10/21/2010)"
+                            class="hide_me" style="width:91px;"
+                            name="activate_box" type="text" /> -->
+                        [% IF ahr.frozen == 't' AND
+                                ahr.thaw_date;
+                            date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td width="106">
+                        <!-- <input title="[% l('Enter a date (e.g. 10/21/2010)') %]"
+                            class="hide_me" style="width:91px;"
+                            name="hold_expires_box" type="text" />-->
+                        [% IF ahr.expire_time;
+                            date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td width="95">
+                        <!-- <select name="hold_active_sel"
+                            style="width:90px;" class="hide_me">
+                            <option value="f">Active</option>
+                            <option value="t">Suspended</option>
+                        </select> -->
+                        [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
+                    </td>
+                    <td width="110">
+                        <div name="acct_holds_status"
+                            style="margin-top:10px;margin-bottom:10px;">
+                            [% PROCESS get_hold_status hold=hold; %]
+                        </div>
+                    </td>
+                    <td class="opac-auto-161">
+                        <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {id => ahr.id}) %]">Edit</a>
+                    </td>
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+        [% END %]
+        </form>
+    </div>
+
+    <span id='myopac.holds.cancel.confirm' class='hide_me'>[% l("Are you sure you wish to cancel the selected holds?") %]</span>
+    <span id='myopac.holds.freeze.confirm' class='hide_me'>[% l("Are you sure you wish to suspend the selected holds?  If an item has already been selected to fulfill the hold, it will not be suspended") %]</span>
+    <span id='myopac.holds.thaw.confirm' class='hide_me'>[% l("Are you sure you wish to activate the selected holds?") %]</span>
+    <span id='myopac.holds.thaw_date.confirm' class='hide_me'>[% l("Are you sure you wish to change the activate date for the selected holds?") %]</span>
+    <span id='myopac.holds.freeze.select_thaw' class='hide_me'>[% l("Select an automatic activation date.  If no date is chosen, the holds will remain suspended until they are manually activated.") %]</span>
+
+    <table width='100%' id='myopac_holds_processing' class='hide_me'>
+        <tr><td>[% l("Processing holds... This may take a moment.") %]</td></tr>
+    </table>
+   
+    <span class='hide_me' id='myopac_holds_cancel_verify'>
+       [% l("If you wish to cancel the selected hold, click OK, otherwise click Cancel.") %]
+    </span>
+</div>
+<div id='myopac_holds_thaw_date_form' class='hide_me'>
+    <div id='myopac_holds_freeze_select_thaw'>
+        [% l("Select an automatic activation date.  If no date is chosen, the holds will remain suspended until they are manually activated.") %]
+    </div>
+    <p>
+        <input size='10' maxlength='10'
+            type='text' id='myopac_holds_thaw_date_input' />
+    </p>
+    <p>
+        <button>[% l("Submit") %]</button>
+    </p>
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/holds/edit.tt2 b/templates_tadlskin/opac/myopac/holds/edit.tt2
new file mode 100644 (file)
index 0000000..293199f
--- /dev/null
@@ -0,0 +1,115 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    PROCESS "opac/parts/hold_status.tt2";
+    PROCESS "opac/parts/org_selector.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "holds"; # in this case, just for tab coloring.
+
+    hold = ctx.holds.0;
+    ahr = hold.hold.hold;
+    attrs = {marc_xml => hold.marc_xml};
+    PROCESS get_marc_attrs args=attrs;
+    hold.human_status = PROCESS get_hold_status hold=hold;
+
+    # Do this up front to avoid verbosity later
+    expire_time = ahr.expire_time ? date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT) : '';
+    thaw_date = ahr.thaw_date ? date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) : '';
+%]
+<div class="pad-bottom-five">
+    <div class="header_middle">
+        <span id="acct_holds_header float-left">[% l('Editing Hold') %]</span>
+        &nbsp; &nbsp; &nbsp; &nbsp;
+        <a href="[% ctx.opac_root %]/myopac/holds">[% l('List all holds') %]</a>
+    </div>
+    <div id="hold_editor">
+        [%  IF hold;
+                title = attrs.title;
+                IF ahr.hold_type == 'P';
+                    title = l('[_1] ([_2])', title, hold.hold.part.label);
+                END 
+        %]
+            <h1>[% title | html %]</h1>
+            <h2>[% attrs.author | html %]</h2>
+            [% IF attrs.format_icon %]<p>
+                <strong>[% l('Format:') %]</strong>
+                <img src="[% attrs.format_icon %]" alt="[% attrs.format_label | html %]" title="[% attrs.format_label | html %]" />
+            </p>[% END %]
+            <p>
+                <strong>[% l('Status') %]</strong>: [% hold.human_status %]
+            </p>
+            <form method="POST">
+                <table id="hold_editor_table">
+                    <tr>
+                        <th>
+                            <input type="hidden" name="action" value="edit" />
+                            <input type="hidden" name="hold_id"
+                                value="[% ahr.id %]" />
+                            [% l('Pickup library') %]
+                        </th>
+                        <td>
+                            [% INCLUDE build_org_selector
+                                name='pickup_lib' value=ahr.pickup_lib %]
+                        </td>
+                    </tr>
+                    [% IF hold.hold.status < 3 %]
+                    [%# The following actions cannot be performed on holds that 
+                        have already been captured... %]
+                    <tr>
+                        <th>
+                            [% l('Cancel unless filled by') %]
+                        </th>
+                        <td>
+                            <input type="text" name="expire_time"
+                                value="[% expire_time | html %]" />
+                        </td>
+                        <td class="fmt-note">
+                            <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
+                            <!-- XXX TODO pick out a minimal, simple, reliable
+                            calendar widget that's not part of some giant,
+                            bloated framework and doesn't do anything at onload.
+                            -->
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>
+                            [% l('Active?') %]
+                        </th>
+                        <td>
+                            <select name="frozen">
+                                <option value="f"[% ahr.frozen == 't' ? '' :' selected="selected"' %]>
+                                    [% l('Yes, this hold is active now') %]
+                                </option>
+                                <option value="t"[% ahr.frozen == 't' ? ' selected="selected"' : '' %]>
+                                    [% l('No, this hold is suspended') %]
+                                </option>
+                            </select>
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>
+                            [% l('If suspended, activate on') %]
+                        </th>
+                        <td>
+                            <input type="text" name="thaw_date"
+                                value="[% thaw_date | html %]" />
+                        </td>
+                        <td class="fmt-note">
+                            <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
+                        </td>
+                    </tr>
+                    [% END %]
+                    <tr>
+                        <td colspan="2" class="hold-editor-controls">
+                            <a href="[% ctx.opac_root %]/myopac/holds"><button 
+                                class="opac-button">[% l('Go Back') %]</button></a>
+                            <input type="submit" value="[% l('Submit') %]" class="opac-button" />
+                        </td>
+                    </tr>
+                </table>
+            </form>
+        [% ELSE;
+            l('Hold not found');
+        END %]
+    </div>
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/list/print.tt2 b/templates_tadlskin/opac/myopac/list/print.tt2
new file mode 100644 (file)
index 0000000..fa3988f
--- /dev/null
@@ -0,0 +1 @@
+[%- ctx.csv.template_output.data -%]
diff --git a/templates_tadlskin/opac/myopac/lists.tt2 b/templates_tadlskin/opac/myopac/lists.tt2
new file mode 100644 (file)
index 0000000..88972c6
--- /dev/null
@@ -0,0 +1,281 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "lists"  
+    limit = ctx.bookbags_limit;
+    offset = ctx.bookbags_offset;
+%]
+<div id='myopac_bookbag_div' style="padding:5px;">
+
+    <!-- new list creation -->
+    <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST" id="create_form">
+        <h1>[% l('Create new list') %]</h1><a name="createnewlist"></a>
+        <table cellpadding="0" border="0" id="list_create_table">
+            <tr>
+                <td>
+                    <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
+                </td>
+                <td>
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                    <input id="list_create_name" type="text" name="name" />
+                    <input type="hidden" name="action" value="create" />
+                </td>
+                <td>
+                    <label for="list_create_shared">[% l('Share this list?') %]</label>
+                    <select name="shared" id="list_create_shared">
+                        <option value="0">[% l('No') %]
+                        <option value="1">[% l('Yes') %]
+                    </select>
+                    <a href="javascript:void(0);" onclick="alert(document.getElementById('bb_publish_text').innerHTML);"><img alt="[% l('Sharing Help') %]"
+                        src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
+                </td>
+                <td class="list-create-table-buttons">
+                    <input type="submit"
+                        value="[% l('Submit') %]"
+                        alt="[% l('Submit') %]"
+                        class="opac-button"/>
+                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                    <input type="reset"
+                        value="[% l('Cancel') %]"
+                        alt="[% l('Cancel') %]"
+                        class="opac-button" />
+                </td>
+            </tr>
+            <tr>
+                <td class="text-right-top">
+                    <label for="list_description">[% l("List description (optional):") %]</label>
+                </td>
+                <td colspan="3">
+                    <textarea cols="40" rows="3" name="description"
+                        id="list_description"></textarea>
+                </td>
+        </table>
+    </form>
+
+    <h1>[% l("Your existing lists") %]</h1>
+    [% INCLUDE "opac/parts/anon_list.tt2" %]
+    [% IF ctx.bookbags.size %]
+    <div class="header_middle">
+        <span class="float-left">[% l('Saved Lists') %]</span>
+        <span class='float-left' style='padding-left: 10px;'>
+            <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {limit => limit, offset => (offset - limit)}) %]'
+                [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
+            [%# TODO: get total to prevent paging off then end of the list.. %]
+            <a href='[% mkurl(ctx.opac_root _ '/myopac/lists', {limit => limit, offset => (offset + limit)}) %]'
+               [% IF ctx.bookbags.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
+        </span>
+    </div>
+    <div class="clear-both"></div>
+
+    <div id='acct_lists_prime'>
+        [% FOR bbag IN ctx.bookbags %]
+        <div class="bookbag-controls-holder">
+            <div class="bookbag-controls most">
+                [% baseurl = ctx.opac_root _ '/myopac/lists';
+                IF bbag.id != CGI.param("bbid");
+                    url = mkurl(baseurl,{bbid => bbag.id},['edit_notes','sort']);
+                    ltitle = l("Show items in list");
+                ELSE;
+                    url = mkurl(baseurl, {}, ['bbid', 'edit_notes', 'sort']);
+                    ltitle = l("Hide items in list");
+                END %]
+                <h2 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a></h2>
+                [% IF bbag.description %]<div class="bookbag-description">[% bbag.description | html %]</div>[% END %]
+            </div>
+            <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
+                <div class="bookbag-share">
+                    <input type="hidden" name="list" value="[% bbag.id %]" />
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                    [% IF bbag.pub != 't' %]
+                    <input type="hidden" name="action" value="show" />
+                    <input class="fixed" type="submit" value="[% l('Share') %]" />
+                    [% ELSE %]
+                    <input type="hidden" name="action" value="hide" />
+                    <input class="fixed" type="submit" value="[% l('Hide') %]" />
+                    [% END %]
+                </div>
+            </form>
+            <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
+                <div class="bookbag-controls">
+                    <input type="hidden" name="list" value="[% bbag.id %]" />
+                    <input type="hidden" name="action" value="delete" />
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                    <input type="submit" value="[% l('Delete List') %]" />
+                </div>
+            </form>
+            <form action="[% mkurl(ctx.opac_root _ '/myopac/list/print') %]" method="POST">
+                <div class="bookbag-controls">
+                    <input type="hidden" name="list" value="[% bbag.id %]" />
+                    <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                    <input type="submit" value="[% l('Download CSV') %]" />
+                </div>
+            </form>
+            <div class="bookbag-controls">
+                [% IF bbag.pub == 't'; %]
+                <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]'><img
+                    alt="[% l('RSS Feed') %]" border="0"
+                    src="[% ctx.media_prefix %]/images/small-rss.png"/></a>
+                [% END %]
+            </div>
+            <div class="bookbag-controls">
+                [% IF bbag.pub == 't'; %]
+                <a href='[%-
+                    mkurl(
+                        ctx.opac_root _ '/results',
+                        {page => '0', bookbag => bbag.id, depth => 0, locg => ctx.search_ou},
+                        1
+                    )
+                -%]'>[% l('HTML View') %]</a>
+                [% END %]
+            </div>
+            <div class="clear-both pad-bottom-five"></div>
+        </div>
+        [% IF CGI.param("bbid") == bbag.id %]
+        <div class="bookbag-specific">
+            <div class="sort">
+                <form method="GET">
+                    <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
+                    [%- INCLUDE "opac/parts/preserve_params.tt2" params=['loc', 'query', 'qtype']; %]
+                    [% INCLUDE "opac/parts/filtersort.tt2"
+                        value=CGI.param('sort') mode='bookbag' %]
+                    <input type="hidden" name="bbid"
+                        value="[% CGI.param('bbid') | html %]" />
+                    <input type="submit" value="[% l('Sort') %]" />
+                </form>
+            </div>
+            <div class="meta">
+                <form method="POST">
+                    <input type="hidden" name="bbid" value="[% bbag.id %]" />
+                    <input type="hidden" name="action" value="editmeta" />
+                    <input type="hidden" name="limit" value="[% limit %]" />
+                    <input type="hidden" name="offset" value="[% offset %]" />
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                    <table id="bbag-name-desc-form">
+                        <tr>
+                            <th>
+                                <label for="bbag-edit-name">[% l('Name:') %]</label>
+                            </th>
+                            <td>
+                                <input name="name" type="text"
+                                    value="[% bbag.name | html %]"
+                                    id="bbag-edit-name" />
+                            </td>
+                            <td rowspan="2" class="saver">
+                                [% l("Save changes to name or description?") %]<br />
+                                <input type="submit" value="[% l('Save') %]" />
+                            </td>
+                        </tr>
+                        <tr>
+                            <th><label for="bbag-edit-description">[% l('Description:') %]</label></th>
+                            <td>
+                                <textarea name="description"
+                                    id="bbag-edit-description">[% bbag.description | html %]</textarea>
+                            </td>
+                        </tr>
+                    </table>
+                </form>
+            </div>
+        </div>
+        <br class="clear-both" />
+        <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
+        <input type="hidden" name="list" value="[% bbag.id %]" />
+        <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
+        <table class="bookbag-specific" cellpadding='0' cellspacing='0' border='0'>
+            <thead id="acct_list_header">
+                <tr>
+                    <td class="list_checkbox">
+                    <input type="checkbox" onclick="
+                        var inputs=document.getElementsByTagName('input'); 
+                        for (i = 0; i < inputs.length; i++) { 
+                            if (inputs[i].name == 'selected_item' && !inputs[i].disabled && inputs[i].getAttribute('bbag') == [% bbag.id %]) 
+                                inputs[i].checked = this.checked;}"/>
+
+                    </td>
+                    <td class="list_entry">
+                        <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
+                    </td>
+                    <td class="list_entry">
+                        <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=>(CGI.param('sort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a>
+                    </td>
+                    <td class="list_entry">
+                        [% l('Notes') %]
+                        [% IF CGI.param("edit_notes") != bbag.id %]
+                        | <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {edit_notes=> bbag.id}) %]">[% l('Edit') %]</a>
+                        [% END %]
+                    </td>
+                    <td class="list_actions">
+                        <select name="action">
+                            <option disabled="disabled">[% l('-- Actions for these items --') %]</option>
+                            <option value="place_hold">[% l('Place hold') %]</option>
+                            <option value="del_item">[% l('Remove from list') %]</option>
+                        </select>
+                        [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                        <input type="submit" value="[% l('Go') %]" />
+                    </td>
+                </tr>
+            </thead>
+            <tbody>
+                [% UNLESS bbag.items.size %]
+                <tr><td colspan="4" class="list_is_empty">
+                    [% l("This list contains no items.") %]
+                </td></tr>
+                [% END %]
+                [% FOR item IN bbag.items;
+                    rec_id = item.target_biblio_record_entry.id;
+                    attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id};
+                    PROCESS get_marc_attrs args=attrs %]
+                <tr class="bookbag-item-row">
+                    <td class="list_checkbox">
+                        <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
+                    </td>
+                    <td class="list_entry">
+                        <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'bbid']) %]">[% attrs.title | html %]</a>
+                    </td>
+                    <td class="list_entry">
+                        <a href="[%- 
+                            authorquery = attrs.author | replace('[,\.:;]', '');
+                            mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page', 'bbid', 'edit_notes'])
+                            -%]">[% attrs.author | html %]</a>
+                    [% IF CGI.param("edit_notes") == bbag.id %]
+                    <td class="list_entry">
+                        [% FOR note IN item.notes %]
+                        <input type="text" name="note-[% note.id %]" value="[% note.note | html %]" />
+                        [% END %]
+                        <input type="text" name="item-[% item.id %]" />
+                    </td>
+                    [% ELSE %]
+                    <td class="list_entry">
+                        [% FOR note IN item.notes %]
+                        <div>[% note.note | html %]</div>
+                        [% END %]
+                    </td>
+                    [% END %]
+                </tr>
+                [% END %]
+                [% IF CGI.param("edit_notes") == bbag.id %]
+                <tr>
+                    <td colspan="3"><!-- All space left of notes column --></td>
+                    <td class="save-notes">
+                        [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                        <input type="hidden" name="bbid" value="[% CGI.param('bbid') | html %]" />
+                        <input type="submit" name="save_notes" value="[% l('Save Notes') %]" />
+                    </td>
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+        </form>
+        [% END %]
+        [% END %]
+    </div>
+    [% END %]
+
+    <span id='bb_publish_text' class='hide_me'>
+[% |l %]Sharing a Bookbag means that the contents 
+of the Bookbag will be visible to others.  
+To see the public view of a shared Bookbag, 
+click on the Bookbag's name in the Bookbag list.[% END %]
+    </span>
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/main.tt2 b/templates_tadlskin/opac/myopac/main.tt2
new file mode 100644 (file)
index 0000000..793653b
--- /dev/null
@@ -0,0 +1,184 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/main_base.tt2";
+    myopac_page = "main";
+    myopac_main_page = "main";
+    myopac_cc_allowed = 0;
+    IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
+        myopac_cc_allowed = 1;
+    END
+%]
+<form action="[% ctx.opac_root %]/myopac/main_payment_form" method="GET">
+    [% IF ctx.fines.circulation.size > 0 %]
+    <div id='myopac_circ_trans_div'>
+        <table width='100%' class='data_grid'>
+            <thead>
+                <tr>
+                    <td colspan='10' style='padding: 6px'>
+                        <strong>[% l("Fines") %]</strong>
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l("Title") %]</td>
+                    <td>[% l("Author") %]</td>
+                    <td>[% l("Checkout Date") %]</td>
+                    <td>[% l("Due Date") %]</td>
+                    <td>[% l("Date Returned") %]</td>
+                    <td>[% l("Balance Owed") %]</td>
+                    [% IF myopac_cc_allowed %]
+                    <td nowrap="nowrap" style="white-space:nowrap;">
+                        <input id="pay_fines_box1" checked="checked"
+                            type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
+                            title="[% l('Click to (un)select all fines') %]" />
+                        <label for="pay_fines_box1">[% l('Pay Fines') %]</label>
+                    </td>
+                    [% END %]
+                </tr>
+            </thead>
+            <tbody id='myopac_circ_trans_tbody'>
+                [% FOR f IN ctx.fines.circulation;
+                    attrs = {marc_xml => f.marc_xml};
+                    IF f.marc_xml;
+                        PROCESS get_marc_attrs args=attrs;
+                    ELSIF f.xact.reservation;
+                        attrs.title = f.xact.reservation.target_resource_type.name;
+                    END %]
+                <tr id='myopac_circ_trans_row'>
+                    <td>
+                        [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
+                        IF recid; %]
+                        <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
+                            {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
+                        [% ELSE %]
+                        [% attrs.title | html %]
+                        [% END %]
+                    </td>
+                    <td>[%- author_query = attrs.author.replace('[,\.:;]', ''); %]
+                        <a href="[% mkurl(ctx.opac_root _ '/results',
+                            {qtype => 'author', query => author_query,
+                            loc => ctx.search_ou}) %]">[% attrs.author | html %]</a>
+                    </td>
+                    <td name='myopac_circ_trans_start'>
+                        [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
+                        IF ts;
+                            date.format(ctx.parse_datetime(ts), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td name='myopac_circ_trans_due'>
+                        [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
+                        IF ts;
+                            date.format(ctx.parse_datetime(ts), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td name='myopac_circ_trans_finished'>
+                        [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
+                            IF ts;
+                                date.format(ctx.parse_datetime(ts), DATE_FORMAT);
+                            ELSE %]
+                            <!-- XXX TODO fines aren't really accruing
+                                if circ has hit maxfines. more clarity
+                                here? -->
+                            <span class="alert">[% l('(fines accruing)') %]</span>
+                        [%  END %]
+                    </td>
+                    <td>
+                        <strong class="alert">
+                            [% money(f.xact.balance_owed) %]
+                        </strong>
+                    </td>
+                    [% IF myopac_cc_allowed %]
+                    <td>
+                        <input type="checkbox" checked="checked" 
+                            title="[% l('Pay this fine') %]" name="xact"
+                            value="[% f.xact.id %]" />
+                    </td>
+                    [% END %]
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+    </div>
+    [% END %]
+
+    [% IF ctx.fines.grocery.size > 0 %]
+    <!-- Table for all non-circulation transactions -->
+    <div id='myopac_trans_div'>
+        <br/>
+        <hr class='opac-auto-013'  color="#dcdbdb" />
+        <br/>
+        <table width='100%' class='data_grid data_grid_center'
+            id='myopac_trans_table'>
+            <thead>
+                <tr>
+                    <td colspan='8' style='padding: 6px'>
+                        <b>[% l("Other Fees") %]</b>
+                    </td>
+                </tr>
+                <tr>
+                    <td width='16%'>[% l("Transaction Start Time") %]</td>
+                    <td width='16%'>[% l("Last Payment Time") %]</td>
+                    <td width='16%'>[% l("Initial Amount Owed") %]</td>
+                    <td width='16%'>[% l("Total Amount Paid") %]</td>
+                    <td width='16%'>[% l("Balance Owed") %]</td>
+                    <td width='16%'>[% l("Billing Type") %]</td>
+                    [% IF myopac_cc_allowed %]
+                    <td width='4%' align="center" nowrap="nowrap"
+                        style="white-space:nowrap;">
+                        <input id="pay_fines_box2" checked="checked"
+                            type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
+                            title="[% l('Click to (un)select all fines') %]" />
+                        <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
+                    </td>
+                    [% END %]
+                </tr>
+            </thead>
+            <tbody id='myopac_trans_tbody'>
+                [% FOR f IN ctx.fines.grocery %]
+                <tr id='myopac_trans_row'>
+                    <td>[% date.format(
+                            ctx.parse_datetime(f.xact.xact_start),
+                            DATE_FORMAT
+                    ) %]</td>
+                    <td>
+                        [%  IF f.xact.last_payment_ts;
+                                date.format(
+                                    ctx.parse_datetime(
+                                        f.xact.last_payment_ts
+                                    ), DATE_FORMAT
+                                );
+                            END %]
+                    </td>
+                    <td>[% money(f.xact.total_owed) %]</td>
+                    <td>[% money(f.xact.total_paid) %]</td>
+                    <td class="alert">
+                        <strong>
+                            [% money(f.xact.balance_owed) %]
+                        </strong>
+                    </td>
+                    <td>[% f.xact.last_billing_type %]</td>
+                    [% IF myopac_cc_allowed %]
+                    <td>
+                        <input type="checkbox" title='[% l("Pay this fine") %]'
+                            name="xact_misc" value="[% f.xact.id %]"
+                            checked="checked" />
+                    </td>
+                    [% END %]
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+    </div>
+    [% END %]
+    [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
+    <div>[% l('You have no current fines.') %]</div>
+    [% ELSIF myopac_cc_allowed %]
+    <div class="text-right pad-top-ten">
+        <input type="submit"
+            value="[% l('Pay selected fines') %]"
+            alt="[% l('Pay selected fines') %]"
+            title="[% l('Pay selected fines') %]"
+            class="opac-button" />
+    </div>
+    [% END %]
+</form>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/main_pay.tt2 b/templates_tadlskin/opac/myopac/main_pay.tt2
new file mode 100644 (file)
index 0000000..9352b45
--- /dev/null
@@ -0,0 +1,58 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "main";
+    myopac_main_page = "pay" %]
+<div id="myopac_summary_div">
+
+    [% IF ctx.payment_response.textcode %]
+        <div class="payment-error">
+            <span title="[% ctx.payment_response.textcode %]">
+                [% ctx.payment_response.desc || ctx.payment_response.textcode %]
+            </span><br />
+            [% ctx.payment_response.note %]
+            [% ctx.payment_response.payload.error_message %]
+        </div>
+        <p>
+            [%
+                url_args = {xact => [], xact_misc => []};
+                FOR k IN ['xact', 'xact_misc'];
+                    FOR val IN CGI.param(k);
+                        url_args.$k.push(val);
+                    END;
+                END;
+                retry_url =  mkurl(ctx.opac_root _ '/myopac/main_payment_form', url_args, 1);
+            %]
+            <br/>
+            <a href="[% retry_url %]">[%
+                l('Go back to try again or to cancel this payment attempt.')
+            %]</a>
+        </p>
+    [% ELSE %]
+        <p><big>[% l('Your payment has been approved.') %]</big></p>
+        [% IF ctx.printable_receipt.template_output;
+            print_args = [];
+            FOR p IN ctx.payment_response.payments;
+                print_args.push('payment=' _ p);
+            END %]
+        <p>[ <a href="[% ctx.opac_root %]/myopac/receipt_print?[% print_args.join('&amp;') %]"
+            target="_egrecpt"
+            onclick="try { print_node('printable-receipt'); } catch (e) { window.print(); } return false;">[% l('Print receipt') %]</a> ]</p>
+        <tt id="printable-receipt">
+            [% ctx.printable_receipt.template_output.data %]
+        </tt>
+        [% ELSE %]
+        <div class="payment-error">
+            [% l(
+                'Error creating receipt: [_1]',
+                    (ctx.printable_receipt.textcode ? ctx.printable_receipt.textcode _ ' / ' _ ctx.printable_receipt.desc : 0) ||
+                    ctx.printable_receipt.error_output.data ||
+                    l('No receipt data returned from server')
+                ) | html %]
+        </div>
+        [% END %]
+        <p>[ <a href="[% ctx.opac_root %]/myopac/main">[%
+            l("Back to Account Summary") %]</a> ]</p>
+    [% END %]
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/main_pay_init.tt2 b/templates_tadlskin/opac/myopac/main_pay_init.tt2
new file mode 100644 (file)
index 0000000..8355710
--- /dev/null
@@ -0,0 +1,15 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "main";
+    myopac_main_page = "pay" %]
+<div id="myopac_summary_div">
+
+    <div class="payment-processing">
+        [% l('Processing...') %] <br/><br/>
+        [% l('Processing your payment may take some time.') %]<br/>
+        [% l("Please do not Refresh or use your browser's Back button or your credit card may be charged more than once.") %]<br/>
+    </div>
+
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/main_payment_form.tt2 b/templates_tadlskin/opac/myopac/main_payment_form.tt2
new file mode 100644 (file)
index 0000000..e91838a
--- /dev/null
@@ -0,0 +1,186 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/main_base.tt2";
+    myopac_page = "main";
+    myopac_main_page = "payment_form";
+
+    last_chance = CGI.param("last_chance");
+
+%]
+[% IF ctx.fines.balance_owed <= 0 %]
+<div>
+    [% l("You either have no fines to pay or you have selected fines whose " _
+        "total is non-positive.  We cannot process non-positive amounts.") %]
+</div>
+[% ELSE %]
+<div id="pay_fines_now">
+    [% IF last_chance %]
+    <p><big>[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]</big></p>
+    <form action="[% ctx.opac_root %]/myopac/main_pay_init" method="POST">
+        [% FOR k IN CGI.Vars;
+            NEXT UNLESS k;
+            FOR val IN CGI.param(k) %]
+        <input type="hidden" name="[% k | html %]" value="[% val | html %]" />
+        [% END; END %]
+        <input type="submit" value="[% l('Submit Payment') %]" />
+        <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
+    [% ELSE %]
+    <form method="POST">
+        <input type="hidden" name="last_chance" value="1" />
+        [% FOR xact IN CGI.param('xact') %]
+        <input type="hidden" name="xact" value="[% xact | html %]" />
+        [% END %]
+        [% FOR xact IN CGI.param('xact_misc') %]
+        <input type="hidden" name="xact_misc" value="[% xact | html %]" />
+        [% END %]
+
+        <table>
+            <tbody>
+                <tr>
+                    <td colspan='2'><strong>[% l('Billing Information') %]</strong></td>
+                    <td rowspan='13' valign='top'>
+                        <p>[% l('Selected fines you are paying for:') %]</p>
+                        <table cellpadding="0" cellspacing="0" border="0" class="myopac_payments_table">
+                            <thead>
+                                <tr>
+                                    <th>[% l('Name') %]</th>
+                                    <th>[% l('Amount') %]</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                            [%
+                            FOR f IN ctx.fines.circulation;
+                                NEXT IF CGI.param('xact').size &&
+                                    !CGI.param('xact').grep(f.xact.id).size;
+                                attrs = {marc_xml => f.marc_xml};
+                                IF f.marc_xml;
+                                    PROCESS get_marc_attrs args=attrs;
+                                ELSIF f.xact.reservation;
+                                    attrs.title = f.xact.reservation.target_resource_type.name;
+                                END %]
+                                <tr>
+                                    <td>[% attrs.title | html %]</td>
+                                    <td class="text-right">[% money(f.xact.balance_owed) %]</td>
+                                </tr>
+                            [%
+                            END;
+                            FOR f IN ctx.fines.grocery;
+                                NEXT IF CGI.param('xact_misc').size &&
+                                    !CGI.param('xact_misc').grep(f.xact.id).size %]
+                                <tr>
+                                    <td>[% f.xact.last_billing_type | html %]</td>
+                                    <td class="text-right">[% money(f.xact.balance_owed) %]</td>
+                                </tr>
+                            [% END %]
+                            </tbody>
+                        </table>
+                        <br />
+                        <div>
+                            [% l('Total amount to pay:') %]
+                            <strong>[% money(ctx.fines.balance_owed) %]</strong>
+                        </div>
+                        <br />
+                        [% | l('<strong>', '</strong>') %]Click [_1]Cancel[_2] to go back and (un)select other fines.[% END %]
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('First Name') %]</td>
+                    <td><input type="text" name="billing_first" value="[% ctx.user.first_given_name | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('Last Name') %]</td>
+                    <td><input type="text" name="billing_last" value="[% ctx.user.family_name | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('Email Address') %]</td>
+                    <td>
+                        <input type="text" disabled="disabled" readonly="readonly" value="[% ctx.user.email | html %]" />
+                        <a href="[% ctx.opac_root %]/myopac/update_email?return_to_referer=1">[% l("Update") %]</a>
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('Street Address') %]</td>
+                    <td><input type="text" name="billing_address" value="[% ctx.user.billing_address.street1 _ ctx.user.billing_address.street2 | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('City' )%]</td>
+                    <td><input type="text" name="billing_city" value="[% ctx.user.billing_address.city | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('State or Province') %]</td>
+                    <td><input type="text" name="billing_state" value="[% ctx.user.billing_address.state | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('ZIP or Postal Code') %]</td>
+                    <td><input type="text" name="billing_zip" value="[% ctx.user.billing_address.post_code | html %]" /></td>
+                </tr>
+                <tr>
+                  <td colspan='2'><strong>[% l('Credit Card Information') %]</strong></td>
+                </tr>
+                <!-- Technically not needed since card type is derived from the CC number
+                <tr>
+                    <td>Type of Card</td>
+                    <td>
+                        <select name="type">
+                            <option value='VISA'>VISA</option>
+                            <option value='MasterCard'>MasterCard</option>
+                            <option value='American Express'>American Express</option>
+                        </select>
+                    </td>
+                </tr>
+                -->
+                <tr>
+                    <td>[% l('Credit Card #') %]</td>
+                    <td><input type="text" name="number" maxlength="16" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('Security Code') %]</td>
+                    <td>
+                        <input type="text" size="4" maxlength="5" name="cvv2" />
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('Expiration Month') %]</td>
+                    <td>
+                        <select name="expire_month">
+                            <option value="01">[% l("January") %]</option>
+                            <option value="02">[% l("February") %]</option>
+                            <option value="03">[% l("March") %]</option>
+                            <option value="04">[% l("April") %]</option>
+                            <option value="05">[% l("May") %]</option>
+                            <option value="06">[% l("June") %]</option>
+                            <option value="07">[% l("July") %]</option>
+                            <option value="08">[% l("August") %]</option>
+                            <option value="09">[% l("September") %]</option>
+                            <option value="10">[% l("October") %]</option>
+                            <option value="11">[% l("November") %]</option>
+                            <option value="12">[% l("December") %]</option>
+                        </select>
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('Expiration Year') %]</td>
+                    <td>
+                        <select name="expire_year">
+                        [% year = date.format(date.now, '%Y');
+                        y = year;
+                        WHILE y < year + 10; # show ten years starting now %]
+                            <option value="[% y %]">[% y %]</option>
+                        [% y = y + 1; END %]
+                        </select>
+                    </td>
+                </tr>
+                <tr>
+                    <td colspan='2' align="center">
+                        <input type="submit" value="[% l('Next') %]" />
+                        <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
+                    </td>
+                </tr>
+                [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]
+            </tbody>
+        </table>
+    [% END %]
+    </form>
+</div>
+[% END %]
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/main_payments.tt2 b/templates_tadlskin/opac/myopac/main_payments.tt2
new file mode 100644 (file)
index 0000000..a30edeb
--- /dev/null
@@ -0,0 +1,59 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/main_base.tt2";
+    myopac_page = "main";
+    myopac_main_page = "payments";
+    limit = ctx.payment_history_limit;
+    offset = ctx.payment_history_offset;
+%]
+
+<div>
+    <div class="header_middle">
+        <span class="float-left">[% l('Payments History') %]</span>
+        <span class='float-left' style='padding-left: 10px;'>
+            <a href='main_payments?limit=[% limit %]&amp;offset=[% offset - limit %]'
+                [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
+            [%# TODO: get total to prevent paging off then end of the list.. %]
+            <a href='main_payments?limit=[% limit %]&amp;offset=[% offset + limit %]'
+               [% IF ctx.payments.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
+        </span>
+    </div>
+    <div class="clear-both"></div>
+
+    [% IF ctx.payments.size %]
+    <table class='myopac_payments_table data_grid' width='100%'>
+        <thead><tr>
+            <th>[% l('Payment Date') %]</th>
+            <th>[% l('Payment For') %]</th>
+            <th>[% l('Amount') %]</th>
+            <th>[% l('Receipt') %]</th> 
+        </tr></thead>
+        <tbody>
+            [% FOR payment IN ctx.payments %]
+            <tr>
+                <td>[% date.format(ctx.parse_datetime(payment.mp.payment_ts), DATE_FORMAT) %]</td>
+                <td>[% 
+                    btype = payment.last_billing_type | html;
+                    ptitle = payment.title | html;
+                    (payment.xact_type == 'grocery') ? btype : ptitle
+                %]</td>
+                <td>[% money(payment.mp.amount) %]</td>
+                <td>
+                    <form action="[% ctx.opac_root %]/myopac/receipt_print" method="POST">
+                        <input type="hidden" name="payment" value="[% payment.mp.id %]" />
+                        <input type="submit" value="[% l('Print') %]" />
+                    </form>
+                    <form action="[% ctx.opac_root %]/myopac/receipt_email" method="POST">
+                        <input type="hidden" name="payment" value="[% payment.mp.id %]" />
+                        <input type="submit" value="[% l('Email') %]" />
+                    </form>
+                </td>
+            </tr>
+            [% END %]
+        </tbody>
+    </table>
+    [% ELSE %]
+    <div>[% l('You have no historical payments to display.') %]</div>
+    [% END %]
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/prefs.tt2 b/templates_tadlskin/opac/myopac/prefs.tt2
new file mode 100644 (file)
index 0000000..418c7ac
--- /dev/null
@@ -0,0 +1,252 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/myopac/prefs_base.tt2";
+    myopac_page = "prefs";
+    prefs_page = 'personal' %]
+
+<div id="acct_info_main">
+    <div id='myopac.expired.alert'
+         class='hide_me'
+         style='margin-bottom: 20px;'>
+        <table class='data_grid'
+               width='100%'>
+            <tbody>
+                <tr>
+                    <td width='100%' class='alert'>
+                        [% l("Your account expired on") %]
+                        <span id='myopac.expired.date'></span>!
+                        [% l("Please see a librarian to renew your account.") %]</td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+
+    <div id='myopac.notes.div'
+         class='hide_me'>
+        <table class='data_grid'
+               width='100%'>
+            <thead>
+                <tr>
+                    <td colspan='2'>
+                    <b>[% l("* Staff Notes *") %]</b></td>
+                </tr>
+            </thead>
+
+            <tbody id='myopac.notes.tbody'>
+                <tr id='myopac.notes.tr'>
+                    <td><b name='title'></b> : <span name=
+                    'value'></span></td>
+                </tr>
+            </tbody>
+        </table><br />
+    </div>
+
+    <table width='70%'
+           class='light_border data_grid'>
+        <tbody id='myopac_summary_tbody'>
+            <tr>
+                <td width='30%'
+                    class='color_4 light_border'>[% l("Name") %]</td>
+
+                <td class='light_border'>[% l(
+                    HUMAN_NAME_FORMAT,
+                    ctx.user.prefix, ctx.user.first_given_name,
+                    ctx.user.second_given_name, ctx.user.family_name,
+                    ctx.user.suffix
+                ) | html %]</td>
+
+                <td></td>
+            </tr>
+
+            <tr>
+                <td class='color_4 light_border'>[% l("Day Phone") %]</td>
+                <td class='light_border'>[% ctx.user.day_phone | html %]</td>
+                <td></td>
+            </tr>
+
+            <tr>
+                <td class='color_4 light_border'>[% l("Evening Phone") %]</td>
+                <td class='light_border'>[% ctx.user.evening_phone | html %]</td>
+                <td></td>
+            </tr>
+
+            <tr>
+                <td class='color_4 light_border'>[% l("Other Phone") %]</td>
+                <td class='light_border'>[% ctx.user.other_phone | html %]</td>
+                <td></td>
+            </tr>
+
+            <tr>
+                <td class='color_4 light_border'>
+                    <div style="position:absolute">
+                        <div class="hide_me" style="position:relative;left:70px;top:-3px;">
+                            <a href="#"><img alt="Username Help" src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
+                        </div>
+                    </div>[% l("Username") %]
+                </td>
+                <td class='light_border'>[% ctx.user.usrname | html %]</td>
+                [% IF ctx.username_change_disallowed %]
+                <td></td>
+                [% ELSE %]
+                <td class='light_border'><a href='update_username'>[% l("Change") %]</a></td>
+                [% END %]
+            </tr>
+            <tr>
+                <td class='color_4 light_border'>[% l("Password") %]</td>
+                <td class='light_border'>[% l("(not shown)") %]</td>
+                <td class='light_border'><a href='update_password'>[% l("Change") %]</a></td>
+            </tr>
+            <tr>
+                <td class='color_4 light_border'>[% l("Email Address") %]</td>
+                <td class='light_border'>[% ctx.user.email | html %]</td>
+                <td class='light_border'><a href='update_email'>[% l('Change') %]</a></td>
+            </tr>
+
+            [% IF ctx.user.ident_value %]<tr class="hide_me">
+                <td class='color_4 light_border'>
+                [% l("Primary Identification") %]</td>
+
+                <td class='light_border'>
+                    [%
+                    # l('[_1] ([_2])', ctx.user.ident_value, ctx.user.ident_type.name) | html
+                    # XXX uncomment the above line to show primary
+                    # identification. With a minor tweak it could
+                    # alternatively be shown but partially obscured. 
+                    %]
+                </td>
+                <td></td>
+            </tr>[% END %]
+
+            <tr>
+                <td class='color_4 light_border'>[% l("Active Barcode") %]</td>
+                <td class='light_border'>[% ctx.user.card.barcode %]</td>
+                <td></td>
+            </tr>
+
+            <tr>
+                <td class='color_4 light_border'>[% l("Home Library") %]</td>
+                <td class='light_border'>[% ctx.user.home_ou.name | html %]</td>
+                <td></td>
+            </tr>
+            <tr>
+                <td class='color_4 light_border'>[% l("Account Creation Date") %]</td>
+                <td class='light_border'>[% date.format(ctx.parse_datetime(ctx.user.create_date), DATE_FORMAT) %]</td>
+                <td></td>
+            </tr>
+        </tbody>
+    </table><br />
+    <hr class='opac-auto-013' color="#DCDBDB" />
+    <br />
+
+    <table width='100%' class='light_border data_grid'>
+        <thead>
+            <tr>
+                <td><strong>[% l("Addresses") %]</strong></td>
+                <td><strong>[% l("Pending Addresses") %]</strong></td>
+            </tr>
+        </thead>
+        <tbody>
+            [% 
+                # cycle through the non-pending address.  For each non-pending addr
+                # that has a corresponding pending addr, render the pending addr 
+                # along the right inside it's own edit form
+                pending = {};
+                regular = [];
+                edit_addr_id = CGI.param('edit_address');
+                FOR addr IN ctx.user.addresses;
+                    IF addr.pending == 't';
+                        replaces = addr.replaces;
+                        pending.$replaces = addr;
+                    ELSE;
+                        regular.push(addr);
+                    END;
+                END;
+            FOR addr IN regular;
+                cur_id = addr.id; 
+                pending_addr = pending.$cur_id;
+            %]
+            <tr>
+                <td>
+                    <!-- read-only address display -->
+                    <table class='light_border'>
+                        <tr><td>[% l("Address Type") %]</td><td>[% addr.address_type | html %]</td></tr>
+                        <tr><td>[% l("Street") %]</td><td>[% addr.street1 | html %]</td></tr>
+                        <tr><td>[% l("Street") %]</td><td>[% addr.street2 | html %]</td></tr>
+                        <tr><td>[% l("City") %]</td><td>[% addr.city | html %]</td></tr>
+                        <tr><td>[% l("County") %]</td><td>[% addr.county| html  %]</td></tr>
+                        <tr><td>[% l("State") %]</td><td>[% addr.state | html %]</td></tr>
+                        <tr><td>[% l("Country") %]</td><td>[% addr.country | html %]</td></tr>
+                        <tr><td>[% l("Zip") %]</td><td>[% addr.post_code | html %]</td></tr>
+                        [% IF ctx.get_org_setting(ctx.user.home_ou.id, 'opac.allow_pending_address') 
+                                AND !pending_addr AND edit_addr_id != cur_id %]
+                        <tr>
+                            <td colspan='2'>
+                                <a href='?edit_address=[% addr.id %]'>[% l('Edit Address') %]</a>
+                            </td>
+                        </tr>
+                        [% END %]
+                    </table>
+                </td>
+
+                <!-- pending address form -->
+                [% IF pending_addr OR edit_addr_id == cur_id;
+                    update_addr = pending_addr || addr %]
+                <td>
+                    <form method='POST'>
+                        [% IF pending_addr %]
+                            <input type='hidden' name='pending_addr' value='[% pending_addr.id %]'/>
+                        [% ELSE %]
+                            <input type='hidden' name='replace_addr' value='[% edit_addr_id | html %]'/>
+                        [% END %]
+                        <table class='pending-addr'>
+                            <tr>
+                                <td>[% l("Address Type") %]</td>
+                                <td><input name='address_type' value='[% update_addr.address_type | html %]'/></td>
+                            </tr>
+                            <tr>
+                                <td>[% l("Street") %]</td>
+                                <td><input name='street1' value='[% update_addr.street1 | html %]'/></td>
+                            </tr>
+                            <tr>
+                                <td>[% l("Street") %]</td>
+                                <td><input name='street2' value='[% update_addr.street2 | html %]'/></td>
+                            </tr>
+                            <tr>
+                                <td>[% l("City") %]</td>
+                                <td><input name='city' value='[% update_addr.city | html %]'/></td>
+                            </tr>
+                            <tr>
+                                <td>[% l("County") %]</td>
+                                <td><input name='county' value='[% update_addr.county| html %]'/></td>
+                            </tr>
+                            <tr>
+                                <td>[% l("State") %]</td>
+                                <td><input name='state' value='[% update_addr.state | html %]'</td>
+                            </tr>
+                            <tr>
+                                <td>[% l("Country") %]</td>
+                                <td><input name='country' value='[% update_addr.country | html %]'/></td>
+                            </tr>
+
+                            <tr>
+                                <td>[% l("Zip") %]</td>
+                                <td><input name='post_code' value='[% update_addr.post_code | html %]'/></td>
+                            </tr>
+                            <tr>
+                                <td><input type='submit' value="[% l('Save Changes') %]"/></td>
+                                <td>
+                                    [% params = (pending_addr) ? {delete_pending => pending_addr.id} : {} %]
+                                    <a href="[% mkurl('', params, 1) %]">[% l('Discard Pending Address') %]</a>
+                                </td>
+                            </tr>
+                            <tr><td colspan='2'><i>[% l('Address changes will be verified by staff') %]</i></td></tr>
+                        </table>
+                    </form>
+                </td>
+                [% END %] <!-- if pending_addr -->
+            </tr>
+            [% END %]
+        </tbody>
+    </table>
+</div>
+
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/prefs_notify.tt2 b/templates_tadlskin/opac/myopac/prefs_notify.tt2
new file mode 100644 (file)
index 0000000..fcd9f47
--- /dev/null
@@ -0,0 +1,97 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/myopac/prefs_base.tt2";
+    myopac_page = "prefs";
+    prefs_page = 'notify' %]
+
+<form method='POST'>
+    [% setting = 'opac.hold_notify' %]
+    <input name='[% setting %]' type="hidden"
+        [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
+
+    <table class="full-width data_grid" id="acct_search_main">
+        <tbody>
+
+            [% IF ctx.updated_user_settings %]
+            <tr><td colspan='2'>
+                <div class='renew-summary'>
+                    [% l('Account Successfully Updated') %]
+                </div>
+            </td></tr>
+            [% END %]
+
+            <tr>
+                <td>[% l('Notify by Email by default when a hold is ready for pickup?') %]</td>
+                <td>
+                    [% setting = 'opac.hold_notify' %]
+                    <input name='[% setting %].email' type="checkbox"
+                        [% IF (matches = ctx.user_setting_map.$setting.match('email')); %] checked='checked' [% END %]/>
+                </td>
+            </tr>
+            <tr>
+                <td>[% l('Notify by Phone by default when a hold is ready for pickup?') %]</td>
+                <td>
+                    [% setting = 'opac.hold_notify' %]
+                    <input name='[% setting %].phone' type="checkbox"
+                        [% IF (matches = ctx.user_setting_map.$setting.match('phone')); %] checked='checked' [% END %]/>
+                </td>
+            </tr>
+            <tr>
+                <td>[% l('Default Phone Number') %]</td>
+                <td>
+                    [% setting = 'opac.default_phone' %]
+                    <input name='[% setting %]' type="text"
+                        [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
+                </td>
+            </tr>
+            [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
+            <tr>
+                <td>[% l('Notify by Text by default when a hold is ready for pickup?') %]</td>
+                <td>
+                    [% setting = 'opac.hold_notify' %]
+                    <input name='[% setting %].sms' type="checkbox"
+                        [% IF (matches = ctx.user_setting_map.$setting.match('sms')); %] checked='checked' [% END %]/>
+                </td>
+            </tr>
+            <tr>
+                <td>[% l('Default Mobile Carrier') %]</td>
+                <td>[% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_label="true" %]</td>
+            </tr>
+            <tr>
+                <td>[% l('Default Mobile Number') %]</td>
+                <td>
+                    [% setting = 'opac.default_sms_notify' %]
+                    <input name='[% setting %]' type="text"
+                        [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
+                    [% l('Hint: use the full 10 digits of your phone #, no spaces, no dashes'); %]
+                </td>
+            </tr>
+            [% END %]
+        </tbody>
+    </table>
+    <table>
+        <thead><tr>
+            <th>[% l('Notification Type') %]</th>
+            <th>[% l('Enabled') %]</th>
+        </tr></thead>
+        <tbody class='data_grid'>
+            [% IF optin.size == 0 %]
+                <strong>[% l('No notification preferences are configured') %]</strong>
+            [% END %]
+            [% FOR optin IN ctx.opt_in_settings %]
+                <tr>
+                    <td>[% optin.cust.label | html %]</td>
+                    <td>
+                        <input type='checkbox' name='setting' 
+                            value='[% optin.cust.name | uri %]' 
+                            [% IF optin.value %] checked='checked' [% END %]/>
+                    </td>
+                </tr>
+            [% END %]
+        </tbody>
+    </table>
+    <input type='submit' value="[% l('Save') %]" alt="[% l('Save') %]" class="opac-button" />
+</form>
+[% END %]
+
+
diff --git a/templates_tadlskin/opac/myopac/prefs_settings.tt2 b/templates_tadlskin/opac/myopac/prefs_settings.tt2
new file mode 100644 (file)
index 0000000..b5d1f70
--- /dev/null
@@ -0,0 +1,98 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/org_selector.tt2";
+    WRAPPER "opac/parts/myopac/prefs_base.tt2";
+    myopac_page = "prefs";
+    prefs_page = 'settings' %]
+
+
+    <form method='POST'>
+
+       <table class="full-width data_grid" id="acct_search_main">
+            <tbody>
+
+                [% IF ctx.updated_user_settings %]
+                <tr><td colspan='2'>
+                    <div class='renew-summary'>
+                        [% l('Account Successfully Updated') %]
+                    </div>
+                </td></tr>
+                [% END %]
+
+                <tr >
+                    <td width='20%'>[% l("Search hits per page") %]</td>
+                    <td>
+                        [% setting = 'opac.hits_per_page' %]
+                        <select name='[% setting %]'>
+                            [%  UNLESS ctx.user_setting_map.$setting;
+                                    ctx.user_setting_map.$setting = 10;
+                                END;
+                                FOR val IN [5, 8, 10, 15, 20, 25, 50] %]
+                                <option value='[% val | uri %]' 
+                                    [% IF ctx.user_setting_map.$setting == val %]
+                                        selected='selected'[% END %]>[% val | html %]</option>
+                            [% END %]
+                        </select>
+                        <a href="#"><img alt="[% l('Search Hits Help') %]" 
+                            src="[% ctx.media_prefix %]/images/question-mark.png"
+                        /></a>
+                    </td>
+                </tr>
+                <tr >
+                    <td width='20%'>[% l("Preferred search location") %]</td>
+                    <td>
+                        [%- setting = 'opac.default_search_location';
+                            thang = ctx.user.home_ou.id;
+                            IF ctx.user_setting_map.$setting;
+                                thang = ctx.user_setting_map.$setting;
+                            END;
+                            INCLUDE build_org_selector name=setting value=thang;
+                        %]
+                    </td>
+                </tr>
+                <tr>
+                    <td width='20%'>[% l("Preferred pickup location") %]</td>
+                    <td>
+                        [%- setting = 'opac.default_pickup_location';
+                            thang = ctx.user.home_ou.id;
+                            IF ctx.user_setting_map.$setting;
+                                thang = ctx.user_setting_map.$setting;
+                            END;
+                            INCLUDE build_org_selector name=setting value=thang can_have_vols_only=1;
+                        %]
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('Keep history of checked out items?') %]</td>
+                    <td>
+                        [% setting = 'history.circ.retention_start' %]
+                        <input name='[% setting %]' type="checkbox"
+                            [% IF ctx.user_setting_map.$setting; %] checked='checked' [% END %]/>
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('Keep history of holds?') %]</td>
+                    <td>
+                        [% setting = 'history.hold.retention_start' %]
+                        <input name='[% setting %]' type="checkbox"
+                            [% IF ctx.user_setting_map.$setting; %] checked='checked' [% END %]/>
+                    </td>
+                </tr>
+
+                <!--
+                <tr>
+                    <td>[% l("Default Font Size") %]</td>
+                    <td>
+                        <select id='prefs_def_font'>
+                            <option value='regular'>[% l("Regular Font") %]</option>
+                            <option value='large'>[% l("Large Font") %]</option>
+                        </select>
+                    </td>
+                </tr>
+                -->
+
+            </tbody>
+        </table>
+        <input type="submit" value="[% l('Save') %]" alt="[% l('Save') %]" class="opac-button"/>
+    </form>
+    [% INCLUDE "opac/parts/myopac/prefs_hints.tt2" %]
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/receipt_email.tt2 b/templates_tadlskin/opac/myopac/receipt_email.tt2
new file mode 100644 (file)
index 0000000..15b744f
--- /dev/null
@@ -0,0 +1,21 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "prefs"  %]
+    [% IF ctx.email_receipt_result; # result should be undef on success %]
+    <div class="payment-error">
+        [% l('Error preparing receipt:') %]
+        <span title="[% ctx.email_receipt_result.textcode | html %]">
+            [% ctx.email_receipt_result.desc | html %]
+        </span>
+    </div>
+    [% ELSE %]
+    <div>
+        [% l('Your receipt will be emailed to [_1]', ctx.user.email) | html %]
+    </div>
+    [% END %]
+    <p>
+        [ <a href="[% ctx.opac_root %]/myopac/main_payments">[%
+            l("Back to Payments History") %]</a> ]
+    </p>
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/receipt_print.tt2 b/templates_tadlskin/opac/myopac/receipt_print.tt2
new file mode 100644 (file)
index 0000000..fe68495
--- /dev/null
@@ -0,0 +1,25 @@
+[%# sic! no wrapper %]
+<html>
+    <head>
+        <title>[% l('Receipt') %]</title>
+    </head>
+    <body onload="if (document.getElementById('printable-receipt')) window.print();">
+        [% IF ctx.printable_receipt.template_output %]
+        <tt id="printable-receipt">
+            [% ctx.printable_receipt.template_output.data %]
+        </tt>
+        [% ELSE %]
+        <div class="payment-error">
+            [% l(
+                'Error preparing receipt: [_1]',
+                    (ctx.printable_receipt.textcode ? ctx.printable_receipt.textcode _ ' / ' _ ctx.printable_receipt.desc : 0) ||
+                    ctx.printable_receipt.error_output.data ||
+                    l('No receipt data returned from server')
+                ) | html %]
+        </div>
+        [% END %]
+        <hr />
+        <p>[ <a href="[% ctx.opac_root %]/myopac/main_payments">[%
+            l("Back to Payments History") %]</a> ]</p>
+    </body>
+</html>
diff --git a/templates_tadlskin/opac/myopac/update_email.tt2 b/templates_tadlskin/opac/myopac/update_email.tt2
new file mode 100644 (file)
index 0000000..6b662bd
--- /dev/null
@@ -0,0 +1,32 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "prefs"  %]
+<div id='myopac_summary_div' style="padding:0px;">
+
+[% IF ctx.invalid_email %]
+    <div id='account-update-email-error'>
+        [% bad_email = ctx.invalid_email | html %]
+        [% l('The email address "<b>[_1]</b>" is invalid.  Please try a different email address.', bad_email) %]
+    </div>
+
+[% ELSIF ctx.password_incorrect %]
+    <div id='account-update-email-error'>
+        [% |l %] Your current password was not correct. [% END %]
+    </div>
+
+[% END %]
+
+<form method='POST' id='account-update-email'>
+    [% IF CGI.param("return_to_referer") %]
+    <input type="hidden" name="redirect_to" value="[% ctx.referer | html %]" />
+    [% END %]
+    <table> 
+        <tr><td>[% l('Current Email') %]</td><td>[% ctx.user.email | html %]</td></tr>
+        <tr><td>[% l('Current Password') %]</td><td><input type='password' name='current_pw'/></td></tr>
+        <tr><td>[% l('New Email') %]</td><td><input type='text' name='email' value='[% ctx.invalid_email | html %]'/></td></tr>
+        <tr><td colspan='2' align='center'><input value="[% l('Submit') %]" type='submit'/></td></tr>
+    </table>
+</form>
+
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/update_password.tt2 b/templates_tadlskin/opac/myopac/update_password.tt2
new file mode 100644 (file)
index 0000000..c87fc5d
--- /dev/null
@@ -0,0 +1,33 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "prefs"  %]
+
+<div id='myopac_summary_div' style="padding:0px;">
+
+[% IF ctx.password_invalid %]
+    <div id='account-update-email-error'> <!-- borrow css from update-email page -->
+        [% |l %] New password is invalid.  Please try a different password.  [% END %]
+    </div>
+
+[% ELSIF ctx.password_nomatch %]
+    <div id='account-update-email-error'>
+        [% |l %] Passwords do not match. [% END %]
+    </div>
+
+[% ELSIF ctx.password_incorrect %]
+    <div id='account-update-email-error'>
+        [% |l %] Your current password was not correct. [% END %]
+    </div>
+[% END %]
+
+<form method='POST' id='account-update-email'> 
+    <table> 
+        <tr><td>[% l('Current Password') %]</td><td><input type='password' name='current_pw'/></td></tr>
+        <tr><td>[% l('New Password') %]</td><td><input type='password' name='new_pw'/></td></tr>
+        <tr><td>[% l('New Password Again') %]</td><td><input type='password' name='new_pw2'/></td></tr>
+        <tr><td colspan='2' align='center'><input value="[% l('Submit') %]" type='submit'/></td></tr>
+    </table>
+</form>
+
+[% END %]
diff --git a/templates_tadlskin/opac/myopac/update_username.tt2 b/templates_tadlskin/opac/myopac/update_username.tt2
new file mode 100644 (file)
index 0000000..a3a0bd2
--- /dev/null
@@ -0,0 +1,37 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "prefs"  %]
+<div id='myopac_summary_div' style="padding:0px;">
+
+[% IF ctx.invalid_username %]
+    <div id='account-update-email-error'> <!-- borrow css from update-email page -->
+        [% bad_user = ctx.invalid_username | html %]
+        [% l('"<b>[_1]</b>" is not a valid username.  Usernames cannot have any spaces or look like a barcode, and may be restricted by policy.  Please try a different username.', bad_user) %]
+    </div>
+
+[% ELSIF ctx.username_exists %]
+    <div id='account-update-email-error'>
+        [% bad_user = ctx.username_exists | html %]
+        [% | l(bad_user) %]
+        The username "<b>[_1]</b>" is taken.  Please try a different username.
+        [% END %]
+    </div>
+
+[% ELSIF ctx.password_incorrect %]
+    <div id='account-update-email-error'>
+        [% |l %] Your current password was not correct. [% END %]
+    </div>
+
+[% END %]
+
+<form method='POST' id='account-update-email'> 
+    <table> 
+        <tr><td>[% l('Current Username') %]</td><td>[% ctx.user.usrname | html %]</td></tr>
+        <tr><td>[% l('Current Password') %]</td><td><input type='password' name='current_pw'/></td></tr>
+        <tr><td>[% l('New Username') %]</td><td><input type='text' name='username' value='[% ctx.invalid_username | html %]'/></td></tr>
+        <tr><td colspan='2' align='center'><input value="[% l('Submit') %]" type='submit'/></td></tr>
+    </table>
+</form>
+
+[% END %]
diff --git a/templates_tadlskin/opac/parts/advanced/expert.tt2 b/templates_tadlskin/opac/parts/advanced/expert.tt2
new file mode 100644 (file)
index 0000000..da8bba6
--- /dev/null
@@ -0,0 +1,32 @@
+<form action="[% ctx.opac_root %]/results" method="GET">
+    <div class="header_middle">[% l("Expert Search") %]</div>
+    <input type="hidden" name="_special" value="1" />
+    [% IF loc %]<input type="hidden" name="loc" value="[% loc %]" />[% END %]
+    <table class="expert-search">
+        <tbody id="adv_expert_rows_here">
+            <tr id="adv_expert_row">
+                <th>[% l("Tag:") %]</th>
+                <td><input type="text" name="tag" size="3" /></td>
+                <th>[% l("Subfield:") %]</th>
+                <td><input type="text" name="subfield" size="1" /></td>
+                <th>[% l("Value:") %]</th>
+                <td><input type="text" name="term" size="16" /></td>
+                <td>
+                    <a href="javascript:;" class="row-remover"
+                        title="[% l('Remove row') %]" alt="[% l('Remove row') %]"
+                        onclick='return killRowIfAtLeast(1, this);'><img src="[% ctx.media_prefix %]/images/adv_row_close_btn.png" /></a>
+                </td>
+            </tr>
+        </tbody>
+        <tfoot>
+            <tr>
+                <td colspan="2"><a href="javascript:addExpertRow();">[ [% l("Add row") %] ]</a></td>
+                <td colspan="4">
+                    <input type="submit" value="[% l('Search') %]"
+                        alt="[% l('Search') %]" title="[% l('Search') %]"
+                        class="opac-button" />
+                </td>
+            </tr>
+        </tfoot>
+    </table>
+</form>
diff --git a/templates_tadlskin/opac/parts/advanced/global_row.tt2 b/templates_tadlskin/opac/parts/advanced/global_row.tt2
new file mode 100644 (file)
index 0000000..02aa5d1
--- /dev/null
@@ -0,0 +1,51 @@
+[%
+    contains_options = [
+        {value => 'contains', label => l('Contains')},
+        {value => 'nocontains', label => l('Does not contain')},
+        {value => 'phrase', label => l('Contains phrase')},
+        {value => 'exact', label => l('Matches exactly')}
+    ];
+    contains = CGI.param('contains');
+    queries = CGI.param('query');
+    bools = CGI.param('bool');
+    qtypes = CGI.param('qtype');
+    rowcount = 3;
+
+    # scalar.merge treats the scalar as a 1-item array
+    WHILE queries.size < rowcount; queries = queries.merge(['']); END;
+    WHILE bools.size < rowcount; bools = bools.merge(['and']); END;
+    WHILE qtypes.size < rowcount; qtypes = qtypes.merge(['keyword']); END;
+
+    FOR qtype IN qtypes;
+        c = contains.shift;
+        b = bools.shift;
+        q = queries.shift; %]
+
+<!-- tag the second row so the bool column won't be hidden -->
+<tr[% IF loop.index == 1 %] id="adv_global_row"[% END %]>
+    <td align='left' width='100%' nowrap='nowrap'>
+
+        <!-- bool selector.  hide for first row.  safe to ignore first bool value in form submission -->
+        <select name='bool' style='width: auto' [% IF loop.first %] class='invisible' [% END %]>
+            <option value='and' [% b == 'and' ? 'selected="selected"' : '' %]>[% l('And') %]</option>
+            <option value='or' [% b == 'or' ? 'selected="selected"' : '' %]>[% l('Or') %]</option>
+        </select>
+
+        <!-- keyword, subject, etc. selector -->
+        <span class="qtype_selector_margin">
+            [% INCLUDE "opac/parts/qtype_selector.tt2"
+                query_type=qtype %]
+        </span>
+
+        <select name='contains' style='margin-right: 7px;'>
+            [% FOR o IN contains_options; -%]
+            <option value="[% o.value %]" [% c == o.value ? ' selected="selected"' : '' %]>[% o.label %]</option>
+            [% END %]
+        </select>
+        <input type='text' size='18' name='query' value="[% q | html %]" x-webkit-speech />
+        <a href="javascript:;" class="row-remover"
+            title="[% l('Remove row') %]" alt="[% l('Remove row') %]"
+            onclick='return killRowIfAtLeast(2, this);'><img src="[% ctx.media_prefix %]/images/adv_row_close_btn.png" /></a>
+    </td>
+</tr>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/advanced/numeric.tt2 b/templates_tadlskin/opac/parts/advanced/numeric.tt2
new file mode 100644 (file)
index 0000000..7262801
--- /dev/null
@@ -0,0 +1,30 @@
+<form action="[% ctx.opac_root %]/results" method="GET">
+    <div class="header_middle">[% l("Numeric Search") %]</div>
+    <input type="hidden" name="contains" value="contains" />
+    <input type="hidden" name="_special" value="1" />
+    [% IF loc %]<input type="hidden" name="loc" value="[% loc %]" />[% END %]
+    <table>
+        <tr>
+            <td>
+                <select name="qtype">
+                    <!-- TODO: Pull labels from config.metabib_field.label -->
+                    <option value="identifier|isbn">[% l('ISBN') %]</option>
+                    <option value="identifier|issn">[% l('ISSN') %]</option>
+                    <option value="identifier|bib_cn">[% l('Bib Call Number') %]</option>
+                    <option value="cnbrowse">[% l('Call Number (Shelf Browse)') %]</option>
+                    <option value="identifier|lccn">[% l('LCCN') %]</option>
+                    <option value="identifier|tcn">[% l('TCN') %]</option>
+                    <option value="item_barcode">[% l('Item Barcode') %]</option>
+                </select>
+            </td>
+            <td>
+                <input type="text" name="query" size="16" />
+            </td>
+        </tr>
+        <tr>
+            <td colspan="2" align="right">
+                <input type="submit" alt="[% l('Search') %]"
+                    value="[% l('Search') %]" class="opac-button" />
+            </td>
+    </table>
+</form>
diff --git a/templates_tadlskin/opac/parts/advanced/search.tt2 b/templates_tadlskin/opac/parts/advanced/search.tt2
new file mode 100644 (file)
index 0000000..697f951
--- /dev/null
@@ -0,0 +1,129 @@
+<form action="[% ctx.opac_root %]/results" method="GET">
+<table id='adv_global_search' class='data_grid data_grid_center' width='100%'>
+    <tr style='border-bottom: none;'>
+        <!-- Contains the user-addable(?) rows to define search class, containment and text -->
+        <td valign='top' class='adv_global_input_container'>
+            <table width='100%' id='adv_global_input_table'>
+                <thead>
+                    <tr>
+                        <td>
+                            <div style="width:100%;" class="header_middle">
+                                [% l("Search Input") %]
+                            </div>
+                        </td>
+                    </tr>
+                </thead>
+                <tbody id='adv_global_tbody'>
+                    [% INCLUDE "opac/parts/advanced/global_row.tt2" %]
+                    <!-- add a new row -->
+                    <tr id='adv_global_addrow'>
+                        <td align='left' style="padding-top:7px;">
+                            <a href="javascript:;" id="myopac_new_global_row" onclick='addSearchRow();'>[% l('Add Search Row') %]</a>
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td align='top'>
+          <div style="width:100%;" class="header_middle">[% l('Search Filters') %]</div>
+          <table cellpadding='10' cellspacing='0' border='0'><tr>
+            <td valign='top'>
+                <strong>[% l("Item Type") %]</strong><br />
+                [%  INCLUDE "opac/parts/coded_value_selector.tt2"
+                        attr=["mattype", "item_type"] multiple="multiple" size="4" %]
+            </td>
+            <td valign='top'>
+                <strong>[% l("Language") %]</strong><br />
+                [%  INCLUDE "opac/parts/coded_value_selector.tt2"
+                        attr="item_lang" multiple="multiple" size="4" %]
+            </td>
+            <td valign='top'>
+                <strong>[% l("Audience") %]</strong><br />
+                    [% INCLUDE "opac/parts/coded_value_selector.tt2"
+                        attr=["audience_group", "audience"] multiple="multiple" size="4" %]
+                </select>
+            </td>
+            <td valign='top'>
+            <strong>[% l("Sort Results") %]</strong>
+              <table class='adv_global_filter_sort'>
+                <tr>
+                    <td align='center' width='100%'>
+                        [% INCLUDE "opac/parts/filtersort.tt2"
+                            value=CGI.param('sort') class='results_header_sel' %]
+                    </td>
+                </tr>
+              </table>
+            </td>
+          </tr></table>
+        </td>
+    </tr>
+    <tr>
+        <td colspan="2">
+            <table cellpadding='10' cellspacing='0' border='0'>
+                <tbody>
+                    <tr>
+                        <td valign='top'>
+                            <strong>[% l("Search Library") %]</strong><br />
+                            [% PROCESS "opac/parts/org_selector.tt2";
+                                INCLUDE build_org_selector show_loc_groups=1 %]
+                            <div style="position:relative;top:7px;">
+                                <input type='checkbox' name="modifier"
+                                    value="available"[% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %]
+                                    id='opac.result.limit2avail' />
+                                <label style="position:relative;top:-2px;"
+                                    for='opac.result.limit2avail'>
+                                    [% l("Limit to Available") %]</label>
+                            </div>
+                        </td>
+                        <td valign='top'>
+                            <strong>[% l("Publication Year") %]</strong><br />
+                            <select name='pubdate' onchange='
+                                if(this.selectedIndex == 3)
+                                    unHideMe($("adv_global_pub_date_2_span"));
+                                else
+                                    hideMe($("adv_global_pub_date_2_span"));'>
+                                    [%  FOR opt IN [
+                                            {"code" => "is", "label" => l("Is")},
+                                            {"code" => "before", "label" => l("Before")},
+                                            {"code" => "after", "label" => l("After")},
+                                            {"code" => "between", "label" => l("Between")} ] %]
+                                        <option value="[% opt.code %]"[% CGI.param('pubdate') == opt.code ? ' selected="selected"' : '' %]>[% opt.label | html %]</option>
+                                    [%  END %]
+                            </select>    
+                            <div style='margin-top:5px;'>
+                                <input name='date1' type='text' size='4' maxlength='4' value="[% CGI.param('date1') | html %]" />
+                                <span id='adv_global_pub_date_2_span' class='[% CGI.param("pubdate") == "between" ? "" : "hide_me" %]'>
+                                   [% l("and") %] <input name='date2' type='text' size='4' maxlength='4' value="[% CGI.param('date2') | html %]" />
+                                </span>
+                            </div>
+                        </td>
+                    </tr>
+                    <!-- TODO: Copy Location Filter -->
+                    <tr class='hide_me'>
+                        <td align='right'>[% l("Shelving Location") %]</td>
+                        <td align='left'>
+                            <select size='3' multiple='multiple'>
+                                [%# TODO: add filter options... %]
+                            </select>
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr class='border_4_2'>
+        <td align="left" colspan='2'>
+            <input type="submit"
+                value="[% l('Search') %]"
+                class='pointer opac-button' />
+            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            <input type="reset"
+                value="[% l('Reset form') %]"
+                class="opac-button" />
+        </td>
+    </tr>
+</table>
+<input type="hidden" name="_adv" value="1" />
+</form>
diff --git a/templates_tadlskin/opac/parts/anon_list.tt2 b/templates_tadlskin/opac/parts/anon_list.tt2
new file mode 100644 (file)
index 0000000..00a898d
--- /dev/null
@@ -0,0 +1,70 @@
+        [% IF ctx.mylist.size %]
+        <div class="bookbag-specific">
+            <form method="GET">
+                <label for="anonsort">[% l("Sort list items by: ") %]</label>
+                [% INCLUDE "opac/parts/filtersort.tt2" mode='bookbag'
+                    id="anonsort" name="anonsort" value=CGI.param("anonsort") %]
+                <input type="hidden" name="id"
+                    value="[% CGI.param('id') | html %]" />
+                [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                <input type="submit" value="[% l('Sort') %]" />
+            </form>
+        </div>
+
+        <form action="[% mkurl(ctx.opac_root _ '/mylist/move') %]" method="GET">
+        <div>
+            <p class="big-strong">[% l('Temporary List') %]</p>
+            <table cellpadding='0' cellspacing='0' border='0'>
+                <thead id="acct_list_header_anon">
+                    <tr>
+                        <td width="1%" style="padding-left:10px;">
+                            <input type="checkbox" onclick="
+                                var inputs=document.getElementsByTagName('input'); 
+                                for (i = 0; i < inputs.length; i++) { 
+                                    if (inputs[i].name == 'record' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
+                        </td>
+                        <td width="49%" class="opac-auto-108"><a href="[% mkurl('', {anonsort=>(CGI.param('anonsort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a></td>
+                        <td width="49%" class="opac-auto-108"><a href="[% mkurl('', {anonsort=>(CGI.param('anonsort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a% l('Author(s)') %]</td>
+                        <td width="1%" class="nowrap">
+                            <select name="action">
+                                <option>[% l('-- Actions for these items --') %]</option>
+                                <option value="place_hold">[% l('Place hold') %]</option>
+                                <option value="delete">[% l('Remove from list') %]</option>
+                                [% IF ctx.user AND ctx.bookbags.size %]
+                                <optgroup label="[% l('Move selected items to bookbag:') %]">
+                                    [% FOR bbag IN ctx.bookbags %]]
+                                    <option value="[% bbag.id %]" class="selector_actions_for_list_inner_option">[% bbag.name | html %]</option>
+                                    [% END %]
+                                </optgroup>
+                                [% END %]
+                            </select>
+                            [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                            <input type="submit" value="[% l('Go') %]" />
+                        </td>
+                    </tr>
+                </thead>
+                <tbody>
+                    [% FOR item IN ctx.mylist;
+                        attrs = {marc_xml => ctx.mylist_marc_xml.$item};
+                        PROCESS get_marc_attrs args=attrs %]
+                    <tr>
+                        <td class="item_list_padding" style="padding-left: 10px;">
+                            <input type="checkbox" name="record" value="[% item %]" />
+                        </td>
+                        <td class="item_list_padding" style="padding-left: 5px;"><a href="[% mkurl(ctx.opac_root _ '/record/' _ item, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a></td>
+                        <td class="item_list_padding" style="padding-left: 5px;"><a href="[%- 
+                            authorquery = attrs.author | replace('[,\.:;]', '');
+                            mkurl(
+                                ctx.opac_root _ '/results',
+                                {qtype => 'author', query => authorquery},
+                                ['page', 'id', 'edit_notes']
+                            )
+                        -%]">[% attrs.author | html %]</a></td>
+                    </tr>
+                    [% END %]
+                </tbody>
+            </table>
+            <br /><br />
+        </div>
+        </form>
+        [% END %]
diff --git a/templates_tadlskin/opac/parts/base.tt2 b/templates_tadlskin/opac/parts/base.tt2
new file mode 100644 (file)
index 0000000..1721a9c
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns='http://www.w3.org/1999/xhtml' lang='[% ctx.locale %]' xml:lang='[% ctx.locale %]'>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+        [% IF ctx.refresh %]
+        <meta http-equiv="refresh" content="[% ctx.refresh %]">
+        [% ELSIF ctx.authtime %]
+        <meta http-equiv="refresh" content="[% ctx.authtime %]; url=[% ctx.logout_page %]">
+        [% END %]
+        <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto.css" />
+        <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/style.css" />
+        <title>[% l('Catalog - [_1]', ctx.page_title) %]</title>
+        <link rel="unapi-server" type="application/xml" title="unAPI" href="/opac/extras/unapi" />
+        [% IF want_dojo %]
+        <style type="text/css">
+            @import "[% ctx.media_prefix %]/js/dojo/dojo/resources/dojo.css";
+            @import "[% ctx.media_prefix %]/js/dojo/dijit/themes/tundra/tundra.css";
+        </style>
+        [% END %]
+        [% INCLUDE 'opac/parts/goog_analytics.tt2' %]
+    </head>
+    <body[% IF want_dojo; ' class="tundra"'; END %]>
+        [% content %] 
+        [% INCLUDE 'opac/parts/footer.tt2' %]
+        [% INCLUDE 'opac/parts/js.tt2' %]
+        [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
+            [%- INCLUDE 'opac/parts/chilifresh.tt2' %]
+        [%- END %]
+    </body>
+</html>
diff --git a/templates_tadlskin/opac/parts/chilifresh.tt2 b/templates_tadlskin/opac/parts/chilifresh.tt2
new file mode 100644 (file)
index 0000000..937e20f
--- /dev/null
@@ -0,0 +1,17 @@
+[%-  IF ENV.OILS_CHILIFRESH_URL AND ENV.OILS_CHILIFRESH_ACCOUNT 
+            AND (ctx.page == 'rresult' OR ctx.page == 'record');
+        chili_url = ENV.OILS_CHILIFRESH_URL;
+        IF CGI.https AND ENV.OILS_CHILIFRESH_HTTPS_URL;
+            chili_url = ENV.OILS_CHILIFRESH_HTTPS_URL;
+        END; 
+%]
+    <!-- Set up the chilifresh account information and load the JS -->
+    <input type="hidden" id="chilifresh_account" name="chilifresh_account" value="[% ENV.OILS_CHILIFRESH_ACCOUNT %]"/>
+    <!--
+    <input type="hidden" id="chilifresh_profile" name="chilifresh_profile" value="[% ENV.OILS_CHILIFRESH_PROFILE %]"/>
+    -->
+    <input type="hidden" id="chilifresh_version" name="chilifresh_version" value="onsite_v1" />
+    <input type="hidden" id="chilifresh_type" name="chilifresh_type" value="search" />
+    <script type="text/javascript" src="[% chili_url %]"></script>
+    <script>try { setTimeout(chili_init, 0); } catch(E) {}</script>
+[%- END %]
diff --git a/templates_tadlskin/opac/parts/coded_value_selector.tt2 b/templates_tadlskin/opac/parts/coded_value_selector.tt2
new file mode 100644 (file)
index 0000000..0016b7a
--- /dev/null
@@ -0,0 +1,34 @@
+
+[%- 
+    # If caller passes a list of possible attribute types, 
+    # search all until we find some values
+
+    IF !attr.size; attr = [attr]; END;
+    all_values = [];
+    attr_class = '';
+    FOR attr_class IN attr;
+        all_values = ctx.search_ccvm('ctype', attr_class);
+        IF all_values.size > 0; LAST; END;
+    END;
+    name = name || "fi:" _ attr_class;
+    id = id || attr_class _ "_selector";
+    values = values || CGI.param(name); 
+-%]
+
+<select id='[% id %]' name='[% name %]'[%
+    multiple ? ' multiple="multiple"' : '';
+    size ? (' size="' _ size _ '"') : ''; %]>
+[% IF none_ok %]
+    <option value=''>[% none_label ? none_label : l('-- Any --') %]</option>
+[% END;
+# turn the list of objects into a list of hashes to 
+# leverage TT's array.sort('<hashkey>') behavior
+sorter = [];
+FOR o IN all_values; 
+    sorter.push({code => o.code, value  => o.value}); 
+END;
+FOR o IN sorter.sort('value') %]
+    <option value='[% o.code | uri %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : '' %]>[% o.value | html %]</option>
+[%  END -%]
+</select>
+
diff --git a/templates_tadlskin/opac/parts/config.tt2 b/templates_tadlskin/opac/parts/config.tt2
new file mode 100644 (file)
index 0000000..9d802e3
--- /dev/null
@@ -0,0 +1,72 @@
+[% 
+
+##############################################################################
+# This file contains skin-level configuration settings.
+# Many of these settings will probably migrate into actor.org_unit_settings.
+##############################################################################
+
+##############################################################################
+# RefWorks configuration
+##############################################################################
+# RefWorks is a Web-based citation manager
+ctx.refworks.enabled = 'false';
+
+# Base URL for RefWorks
+ctx.refworks.url = 'http://www.refworks.com';
+
+# Some sites have a hosted RefWorks instance at a different URL;
+# in addition, you might want to proxy access to RefWorks - for example:
+# ctx.refworks.url = 'http://librweb.laurentian.ca/login?url=http://refworks.scholarsportal.info';
+
+##############################################################################
+# OpenURL resolution
+##############################################################################
+# Evergreen provides the ability to point at an OpenURL resolver to find
+# electronic resources for a given ISSN or ISBN. Currently, only the SFX
+# resolver is supported.
+#
+# You must enable the open-ils.resolver instance in opensrf.xml to use
+# this feature.
+##############################################################################
+
+openurl.enabled = 'false';
+openurl.baseurl = 'http://sfx.example.com/instance';
+
+##############################################################################
+# Google Analytics support
+##############################################################################
+# You can enable Google Analytics support in Evergreen by entering a
+# valid Google Analytics code and changing 'false' to 'true'
+##############################################################################
+google_analytics.enabled = 'false';
+google_analytics.code = 'UA-9999999-99';
+
+##############################################################################
+# Enable "Forgot your password?" prompt at login
+##############################################################################
+reset_password = 'true';
+
+##############################################################################
+# Misc. UI Settings
+##############################################################################
+
+##############################################################################
+# Size of the jacket image to display on the record detail summary.
+# Sizes vary depending on added content provider.
+# Options are "small", "medium", and "large"
+record.summary.jacket_size = 'medium';
+
+
+##############################################################################
+# Define the order in which facets are displayed.  Only facets listed here 
+# will be displayed.  To show all facets sorted by name, comment out this 
+# setting.  
+# facet.display = [] # show no facets
+facet.display = [
+    {facet_class => 'author',  facet_order => ['personal', 'corporate']},
+    {facet_class => 'subject', facet_order => ['topic']},
+    {facet_class => 'series',  facet_order => ['seriestitle']},
+    {facet_class => 'subject', facet_order => ['name', 'geographic']}
+];
+
+%]
diff --git a/templates_tadlskin/opac/parts/filtersort.tt2 b/templates_tadlskin/opac/parts/filtersort.tt2
new file mode 100644 (file)
index 0000000..8d47979
--- /dev/null
@@ -0,0 +1,15 @@
+<select [% class ? ('class="' _ class _ '"') : '' %] id='[% id || "opac.result.sort" %]' name="[% name || 'sort' %]" [% IF submit_on_change %]onchange='this.form.submit()'[% END %]>
+    [% IF mode != 'bookbag' %]<option value=''>[% l("Sort by Relevance") %]</option>[% END %]
+    <optgroup label='[% l("Sort by Title") %]'>
+        <option value='titlesort'[% value == 'titlesort' ? ' selected="selected"' : '' %]>[% l("Title: A to Z") %]</option>
+        <option value='titlesort.descending'[% value == 'titlesort.descending' ? ' selected="selected"' : '' %]>[% l("Title: Z to A") %]</option>
+    </optgroup>
+    <optgroup label='[% l("Sort by Author") %]'>
+        <option value='authorsort'[% value == 'authorsort' ? ' selected="selected"' : '' %]>[% l("Author: A to Z") %]</option>
+        <option value='authorsort.descending'[% value == 'authorsort.descending' ? ' selected="selected"' : '' %]>[% l("Author: Z to A") %]</option>
+    </optgroup>
+    <optgroup label='[% l("Sort by Publication Date") %]'>
+        <option value='pubdate.descending'[% value == 'pubdate.descending' ? ' selected="selected"' : '' %]>[% l("Date: Newest to Oldest") %]</option>
+        <option value='pubdate'[% value == 'pubdate' ? ' selected="selected"' : '' %]>[% l("Date: Oldest to Newest") %]</option>
+    </optgroup>
+</select>
diff --git a/templates_tadlskin/opac/parts/footer.tt2 b/templates_tadlskin/opac/parts/footer.tt2
new file mode 100644 (file)
index 0000000..76c6b7a
--- /dev/null
@@ -0,0 +1,33 @@
+[%- 
+    USE CGI = CGI_utf8;
+    hostname = CGI.url({'-base' => 1});
+-%]
+<div id="footer-wrap">
+<div id="footer">
+    <a href="[% hostname %]">[% l('Dynamic catalog') %]</a> &nbsp;|&nbsp;
+    <a href="http://example.com">[% l('Bottom Link 2') %]</a> &nbsp;|&nbsp;
+    <a href="http://example.com">[% l('Bottom Link 3') %]</a> &nbsp;|&nbsp;
+    <a href="http://example.com">[% l('Bottom Link 4') %]</a> &nbsp;|&nbsp;
+    <a href="http://example.com">[% l('Bottom Link 5') %]</a>
+    [% IF ctx.timing %]
+    <div id="timing">
+        [% FOR event IN ctx.timing %]
+        At <span class="timing-time">[% event.0 | format("%0.4f") %]</span>:
+        <span class="timing-event">[% event.1 %]</span><br />
+        [% END %]
+    </div>
+    [% END %]
+    <div id="copyright_text" style="margin-top: 2em;">
+        [% l('Copyright &copy; 2006-[_1] Georgia Public Library Service, and others', date.format(date.now, '%Y')) %]
+    </div>
+    <div id="footer_logo">
+        [% l('Powered by') %]
+        <a href="http://evergreen-ils.org">
+            <img src="[% ctx.media_prefix %]/opac/images/eg_tiny_logo.png"
+                style="border:none; width: 94px; height: 16px;"
+                alt="[% l('Evergreen') %]"
+            />
+        </a>
+    </div>
+</div>
+</div>
diff --git a/templates_tadlskin/opac/parts/goog_analytics.tt2 b/templates_tadlskin/opac/parts/goog_analytics.tt2
new file mode 100644 (file)
index 0000000..ce1e1ae
--- /dev/null
@@ -0,0 +1,18 @@
+[%- PROCESS "opac/parts/header.tt2";
+    IF google_analytics.enabled == 'true' %]
+
+<!-- http://www.google.com/support/googleanalytics/bin/answer.py?answer=174090 -->
+<script type="text/javascript">
+    var _gaq = _gaq || [];
+    _gaq.push(['_setAccount', '[% google_analytics.code %]']);
+    _gaq.push(['_trackPageview']);
+
+    (function() {
+        var ga = document.createElement('script'); 
+        ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; 
+        s.parentNode.insertBefore(ga, s);
+    })();
+</script>
+[%- END %]
diff --git a/templates_tadlskin/opac/parts/header.tt2 b/templates_tadlskin/opac/parts/header.tt2
new file mode 100644 (file)
index 0000000..ba75412
--- /dev/null
@@ -0,0 +1,99 @@
+[%- USE money = format(l('$%.2f'));
+    USE date;
+    USE CGI = CGI_utf8;
+    USE POSIX;
+    USE HTML;
+    SET DATE_FORMAT = l('%m/%d/%Y');
+    PROCESS "opac/parts/config.tt2";
+
+    # Don't wrap in l() here; do that where this format string is actually used.
+    SET HUMAN_NAME_FORMAT = '[_1] [_2] [_3] [_4] [_5]';
+
+    is_advanced = CGI.param("_adv").size;
+    is_special = CGI.param("_special").size;
+
+    # -----------------------------------------------------------------------------
+    # mkurl( destination_page, params_to_set, params_to_clear )
+    #
+    # Current page, updated params:
+    # mkurl('', {foo => 'bar', boo => 'baz'});
+    #
+    # New page, one param is a list:
+    # mkurl('http://flarg.baz/squz', {foo => 'bar', boo => ['baz', 'faz']});
+    #
+    # New page, clear all existing params before applying new ones:
+    # mkurl('/fuz/buster', {foo => 'bar', boo => 'baz'}, 1); 
+    #
+    # Current page, clear 'some_param' from the existing params:
+    # mkurl('', {foo => 'bar', boo => 'baz'}, ['some_param']);
+    #
+    # Current page to a named anchor 'copies'
+    # mkurl('', {}, [], 'copies');
+    MACRO mkurl(page, params, clear_params, named_anchor) BLOCK;
+
+        # clone the query string to avoid clobberation
+        cgi = CGI.new(CGI.query_string);
+
+        # remove requested params
+        IF clear_params.0; # array
+            FOR p IN clear_params; cgi.delete(p); END;
+        ELSIF clear_params;
+            cgi.delete_all();
+        END;
+
+        # x and y are artifacts of using <input type="image" /> tags 
+        # instead of true submit buttons, and their values are never used.
+        cgi.delete('x', 'y'); 
+
+        # apply user params
+        FOR k IN params.keys;
+            encoded = [];
+            max = params.$k.max;
+
+            # The following commented-out line can be fooled. Its replacement
+            # below is what you really mean.
+            # list = (params.$k.0 OR max == -1) ? params.$k : [params.$k];
+            list = params.$k.list;
+
+            IF list.size == 0; NEXT; END;
+            # CGI croaks on already-decoded strings.  force-encode to be safe.
+            FOR p IN list; encoded.push(ctx.encode_utf8(p)); END;
+            foo = cgi.param("-name", k, "-values", encoded);
+        END;
+
+        # for url brevity, remove any params that have no value
+        FOR p IN cgi.param;
+            val = cgi.param(p);
+            IF val == ''; cgi.delete(p); END;
+
+            # Delete POST vars unless we asked for them
+            UNLESS CGI.url_param(p).defined OR params.defined(p);
+                cgi.delete(p);
+            END;
+        END;
+
+        final = named_anchor ? '#' _ named_anchor : '';
+
+        IF page;
+            IF cgi.query_string;
+                page _ '?' _ cgi.query_string _ final;
+            ELSE;
+                page _ final;
+            END;
+        ELSE;
+            # staying on the current page
+            cgi.url("-path" => 1, "-query" => 1) _ final;
+        END;
+    END;
+
+    # Whether we want Dojo or not may one day be a wholly distinct
+    # concern from whether we want autosuggest, so let's get used to
+    # defining that separately.
+    want_dojo = 0;
+
+    use_autosuggest = ctx.get_cgf("opac.use_autosuggest");
+
+    IF use_autosuggest.enabled == "t";
+        want_dojo = 1;
+    END;
+%]
diff --git a/templates_tadlskin/opac/parts/hold_error_messages.tt2 b/templates_tadlskin/opac/parts/hold_error_messages.tt2
new file mode 100644 (file)
index 0000000..50a0ebf
--- /dev/null
@@ -0,0 +1,42 @@
+[%
+    # XXX It might be cleaner to move this into its own file or something.
+    #
+    # The following hash should have fail_parts as keys and user/patron-friendly
+    # strings as values.  If the system returns an event with a fail_part when
+    # you attempt to place a hold and the fail part matches something in this
+    # hash, this is the message that will be displayed to the user. Wait until
+    # these are used to pass them through l() for i18n.
+
+    FAIL_PART_MSG_MAP = {
+        "actor.usr.barred" => l("The patron is barred"),
+        "asset.copy.circulate" => l("The item does not circulate"),
+        "asset.copy_location.circulate" => l("Items from this shelving location do not circulate"),
+        "asset.copy.status" => l("The item cannot circulate at this time"),
+        "circ.holds.target_skip_me" => l("The item's circulation library does not fulfill holds"),
+        "config.circ_matrix_circ_mod_test" => l("The patron has too many items of this type checked out"),
+        "config.circ_matrix_test.available_copy_hold_ratio" => l("The available item-to-hold ratio is too low"),
+        "config.circ_matrix_test.circulate" => l("Circulation rules reject this item as non-circulatable"),
+        "config.circ_matrix_test.total_copy_hold_ratio" => l("The total item-to-hold ratio is too low"),
+        "config.hold_matrix_test.holdable" => l("Hold rules reject this item as unholdable"),
+        "config.hold_matrix_test.max_holds" => l("The patron has reached the maximum number of holds"),
+        "config.rule_age_hold_protect.prox" => l("The item is too new to transit this far"),
+        "item.holdable" => l("The item is not holdable"),
+        "location.holdable" => l("The item's location is not holdable"),
+        "status.holdable" => l("The item is not in a holdable status"),
+        "no_item" => l("The system could not find this item"),
+        "no_ultimate_items" => l("The system could not find any items to match this hold request"),
+        "no_matchpoint" => l("System rules do not define how to handle this item"),
+        "no_user" => l("The system could not find this patron"),
+        "transit_range" => l("The item cannot transit this far")
+    };
+
+
+    # This works like the above has, but instead of fail_parts for keys, use
+    # the textcode of the event.  This will only be consulted for events
+    # that do not have a fail_part matching something in the above hash.
+    # Wait until these are used to pass them through l() for i18n.
+
+    EVENT_MSG_MAP = {
+        "PATRON_EXCEEDS_FINES" => l("Patron has reached the maximum fine amount")
+    };
+%]
diff --git a/templates_tadlskin/opac/parts/hold_status.tt2 b/templates_tadlskin/opac/parts/hold_status.tt2
new file mode 100644 (file)
index 0000000..0cabbec
--- /dev/null
@@ -0,0 +1,29 @@
+[% BLOCK get_hold_status %]
+    <div>
+    [% 
+        IF hold.hold.status == 4;
+            l("Available") | html;
+            IF ahr.shelf_expire_time;
+                '<br/>';
+                l('Expires [_1]', 
+                    date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT)) | html;
+            END;
+
+        ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
+            # estimated wait is delivered as seconds.
+            SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400);
+            l("Estimated wait: [quant,_1,day,days]", hwait) | html;
+
+        ELSIF hold.hold.status == 3 OR hold.hold.status == 8;
+            l("In Transit") | html;
+
+        ELSIF hold.hold.status < 3;
+            l("Waiting for copy") | html;
+        END 
+    %]
+    </div>
+    <div>
+        [% l('[_1] hold on [quant,_2,circulating copy,circulating copies]', 
+            hold.hold.queue_position, hold.hold.potential_copies) | html %]
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/homesearch.tt2 b/templates_tadlskin/opac/parts/homesearch.tt2
new file mode 100644 (file)
index 0000000..e99e1b1
--- /dev/null
@@ -0,0 +1,3 @@
+<div id="homesearch_main_logo">
+    <strong><center><img src="[% ctx.media_prefix %]/opac/images/main_logo.png" /></center></strong>
+</div>
diff --git a/templates_tadlskin/opac/parts/js.tt2 b/templates_tadlskin/opac/parts/js.tt2
new file mode 100644 (file)
index 0000000..df50a03
--- /dev/null
@@ -0,0 +1,80 @@
+<!-- JS imports, etc.  -->
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/opac/simple.js"></script>
+
+[%- IF ctx.is_staff %]
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/opac/staff.js"></script>
+    [% IF ctx.page == 'record' %]
+        [% IF ctx.search_result_index >= 0 %]
+        <script>
+            rdetail_next_prev_actions(
+                "[% ctx.search_result_index %]",
+                "[% ctx.hit_count %]",
+                "[% ctx.prev_rec_url || '' %]",
+                "[% ctx.next_rec_url || '' %]",
+                "[% mkurl(ctx.first_search_record, {page => 0}) %]",
+                "[% mkurl(ctx.opac_root _ '/results', {find_last => 1, page => POSIX.floor(ctx.hit_count / ctx.page_size)}) %]",
+                "[% mkurl(ctx.opac_root _ '/results', {}, ['expand','cnoffset']) %]"
+            );
+        </script>
+        [% END %]
+        [% IF ctx.mfhd_summaries.size %]
+        <script>
+            window.mfhdDetails = [
+                [% FOR summary IN ctx.mfhd_summaries %]
+                {
+                    'id' : '[% summary.sre_id %]', 
+                    'label' : '[% summary.location %]',
+                    'entryNum' : '[% loop.index %]',
+                    'owning_lib' : '[% summary.owning_lib %]'
+                },
+                [% END %]
+            ];
+        </script>
+        [% END %]
+    [% END %]
+[%- END %]
+
+[%- IF ENV.OILS_NOVELIST_URL AND ctx.page == 'record';
+    url = ENV.OILS_NOVELIST_URL;
+    IF CGI.https; url = url.replace('^http:', 'https:'); END; %]
+<script type='text/javascript' id='EIT' src='[% url %]'></script>
+[%- END %]
+[%- IF want_dojo; -%]
+<script type="text/javascript">
+     var djConfig = {
+         locale: "[% ctx.locale | lower | replace('_', '-') %]",
+         parseOnLoad: true,
+         isDebug: false
+     }, lang, bidi;
+</script>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/dojo.js?[% ctx.eg_cache_hash %]"></script>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/openils_dojo.js?[% ctx.eg_cache_hash %]"></script>
+
+[%- # So the following works in Mozilla and Chrome, but not in IE8.
+    # Seems like it /should/ work anywhere, though, and obviate the
+    # next three script tags: %]
+<!-- <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/DojoSRF.js?[% ctx.eg_cache_hash %]"></script> -->
+
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf.js?[% ctx.eg_cache_hash %]"></script>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf_xhr.js?[% ctx.eg_cache_hash %]"></script>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/JSON_v1.js?[% ctx.eg_cache_hash %]"></script>
+
+[% IF use_autosuggest.enabled == "t"; %]
+<script type="text/javascript">
+    dojo.require("openils.widget.AutoSuggest");
+
+    /* Set focus, and place the cursor at the end of the input string */
+    dojo.addOnLoad(function() {
+        dijit.byId('search_box').focus();
+
+        var sb_value = dijit.byId('search_box').value;
+        /* Dojo won't trigger a change if the value doesn't change */
+        if (sb_value) {
+            dijit.byId('search_box').setValue(sb_value + ' ');
+            dijit.byId('search_box').setValue(sb_value);
+        }
+    });
+</script>
+[% END; # use_autosuggest %]
+
+[%- END; # want_dojo -%]
diff --git a/templates_tadlskin/opac/parts/login/form.tt2 b/templates_tadlskin/opac/parts/login/form.tt2
new file mode 100644 (file)
index 0000000..48f2f67
--- /dev/null
@@ -0,0 +1,146 @@
+<!-- TODO: MOVE INTO SEPARATE FORGOT-PASSWORD PAGE 
+
+<div class="hide_me">
+       <div class='login_text color_1' style='padding: 4px; text-align: center;'>
+               <span>[% l("Login") %]</span>
+       </div>
+       <br/>
+</div>
+<table id='change_pw_table' class='data_grid hide_me' style='margin-left: 20px;' width='95%'>
+       <thead>
+        <tr><td colspan='2' align='center'><b>[% l("Password") %]</b></td></tr>
+    </thead>
+    <tbody>
+        <tr>
+            <td colspan='2' style='padding:10px;'>
+                [% l("This appears to be the first time you have logged in.  You will need to change your password.") %]
+                [% l("The password must be at least 7 characters in length,
+ contain at least one letter (a-z/A-Z),
+ and contain at least one number.") %]
+            </td>
+        </tr>
+        <tr>
+            <td>[% l("Enter your current password") %]</td>
+            <td><input type='password' id='change_pw_current'/></td>
+        </tr>
+        <tr>
+            <td>[% l("Enter the new password") %]</td>
+            <td><input type='password' id='change_pw_1'/></td>
+        </tr>
+        <tr>
+            <td>[% l("Re-type the new password for verification") %]</td>
+            <td><input type='password' id='change_pw_2'/></td>
+        </tr>
+        <tr><td><br/></td><td/></tr>
+        <tr class='color_1'>
+            <td colspan='2' align='center'>
+                <span class='login_text' style='margin-right: 20px;'>
+                    <input type='submit' value='[% l("Update Password") %]'  id='change_pw_button'/>
+                </span>
+            </td>
+        </tr>
+    </tbody>
+</table>
+
+
+<span id='pw_no_match' class='hide_me'>[% l("Passwords do not match") %]</span>
+<span id='pw_update_successful' class='hide_me'>[% l("Password successfully updated") %]</span>
+<span id='pw_not_strong' class='hide_me'>
+    [% l("The password provided is not strong enough.") %]
+    [% l("The password must be at least 7 characters in length, contain at least one letter (a-z/A-Z), and contain at least one number.") %]
+</span>
+
+ ^== TODO: MOVE INTO SEPARATE FORGOT-PASSWORD PAGE  -->
+
+[% IF ctx.login_failed_event %]
+<div id='login-failed-message'>
+[%
+    IF ctx.login_failed_event.textcode == 'PATRON_CARD_INACTIVE';
+        l("The barcode used to login is marked as inactive.  Please contact your local library.");
+    ELSIF ctx.login_failed_event.textcode == 'PATRON_INACTIVE';
+        l("This account has been deactivated.  Please contact your local library.");
+    ELSE;
+        l("Login failed. The username or password provided was not valid.  
+            Ensure Caps-Lock is off and try again or contact your local library.");
+    END;
+%]
+</div>
+[% END %]
+
+<div>
+    <div style="height:20px;"></div>
+    <form method='POST'>
+        <table cellpadding="0" cellspacing="0" border="0">
+            <tr>
+                <td valign="top" width="676" class="login_boxes left_brain">
+                    <table cellpadding="0" cellspacing="0" border="0"
+                        width="100%">
+                        <tr>
+                               <td colspan="2" style="padding-bottom: 10px;">
+                                <h1>[% l('Log in to Your Account') %]</h1>
+                                [% l('Please enter the following information:') %]
+                                <br /><br />
+                            </td>
+                        </tr>
+                        <tr>
+                            <td width="42%" class="lbl1">
+                                [% l('Library Card Number or Username') %]
+                                <br />
+                                <span class="lbl2">
+                                    [% l('Please include leading zeros and no spaces.') %]
+                                    <br/>
+                                    [% l('Example: 0026626051') %]
+                                </span>
+                                <br /><br />
+                            </td>
+                            <td width="58%" valign="top">
+                                <div class="input_bg">
+                                    <input type="text" id="username_field" name="username"/>
+                                </div>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td colspan="2">
+                                <div style="height:15px;"></div>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td valign="top" class="lbl1">
+                                [% l('PIN Number or Password') %]<br />
+                                [% INCLUDE "opac/parts/login/password_hint.tt2" %]
+                            </td>
+                            <td valign="top">
+                                <div class="input_bg">
+                                    <input name="password" type="password" />
+                                </div>
+                                <div style="padding-top:7px;">
+                                    [%
+                                        # If no redirect is offered or it's leading us back to the 
+                                        # login form, redirect the user to My Account
+                                        redirect = CGI.param('redirect_to') || ctx.referer;
+                                        IF !redirect OR redirect.match(ctx.path_info _ '$');
+                                            redirect = CGI.url('-full' => 1) _ '/opac/myopac/main';
+                                        END;
+                                        redirect = redirect  | replace('^http:', 'https:');
+                                    %]
+                                    <input type='hidden' name='redirect_to' value='[% redirect %]'/>
+                                    <input type="checkbox" name="persist" id="login_persist" /><label for="login_persist"> [% l('Stay logged in?') %]</label>
+                                </div>
+                                <div style="padding-top:14px;">
+                                    <input type="submit" value="[% l('Log in') %]" alt="[% l('Log in') %]" class="opac-button" />
+                                    [% IF reset_password %]
+                                    <a href='[% mkurl(ctx.opac_root _ '/password_reset', {}, 1) %]'>[% l('Forgot your password?') %]</a>
+                                    [% END %]
+                                </div>
+                            </td>
+                        </tr>
+                    </table>
+                    <br /><br />
+                </td>
+                   <td><div style="width:10px;"></div></td>
+                [% INCLUDE "opac/parts/login/help.tt2" %]
+            </tr>
+        </table>
+    </form>
+    <div class="clear-both"></div>
+</div>
diff --git a/templates_tadlskin/opac/parts/login/help.tt2 b/templates_tadlskin/opac/parts/login/help.tt2
new file mode 100644 (file)
index 0000000..16db31f
--- /dev/null
@@ -0,0 +1,12 @@
+<td class="login_boxes right_brain" align="center" valign="top" width="291">
+
+    <a href="http://example.com"><img 
+        src="[% ctx.media_prefix %]/images/questions.png" alt="[% l('Questions?') %]" style="margin-top:29px;" /></a>
+
+    <div style="width:182px;color:black;padding:5px 25px;">
+        [% l('Visit our FAQs section for answers to common questions about how to use your account.') %]
+    </div>
+
+    <a href="http://example.com"><img
+        alt="[% l('FAQs') %]" src="[% ctx.media_prefix %]/images/faqs-btn.png" style="margin-top:13px;" /></a>
+</td>
diff --git a/templates_tadlskin/opac/parts/login/password_hint.tt2 b/templates_tadlskin/opac/parts/login/password_hint.tt2
new file mode 100644 (file)
index 0000000..a95b47f
--- /dev/null
@@ -0,0 +1,5 @@
+<span class="lbl2">
+    [% | l('<br/>', '<br/>') %]
+       If this is your first time logging in, please enter [_1] the last 4 digits of your phone number. [_2] Example: 0926
+    [% END %]
+</span>
diff --git a/templates_tadlskin/opac/parts/misc_util.tt2 b/templates_tadlskin/opac/parts/misc_util.tt2
new file mode 100644 (file)
index 0000000..fe4d97f
--- /dev/null
@@ -0,0 +1,270 @@
+[% 
+    # Extract MARC fields from XML
+    #   get_marc_attrs( { marc_xml => doc } )
+    BLOCK get_marc_attrs;
+        xml = args.marc_xml;
+
+        # Map item types to schema.org types; impedance mismatch :(
+        args.schema.itemtype = {};
+        schema_typemap = {};
+        schema_typemap.a = 'http://schema.org/Book';
+        schema_typemap.j = 'http://schema.org/MusicRecording';
+
+        args.isbns = [];
+        FOR isbn IN xml.findnodes('//*[@tag="020"]/*[@code="a"]');
+            args.isbns.push(isbn.textContent);
+        END;
+
+        args.upcs = [];
+        FOR upc IN xml.findnodes('//*[@tag="024"]/*[@code="a"]');
+            args.upcs.push(upc.textContent);
+        END;
+        args.upc = args.upcs.0; # use first UPC as the default
+
+        args.issns = [];
+        FOR sub IN xml.findnodes('//*[@tag="022"]/*[@code="a"]');
+            args.issns.push(sub.textContent);
+        END;
+        args.issn = (args.issns.size) ? args.issn.0 : '';
+
+        args.authors = [];
+        FOR sub IN xml.findnodes('//*[@tag="100"]/*[@code="a"]');
+            args.authors.push(sub.textContent);
+        END;
+        args.author = (args.authors.size) ? args.authors.0 : '';
+
+        # Include subfields 'abnp' to generate a more comprehensive title display in search results
+        titresults = xml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b" or @code="n" or @code="p"]');
+        titresults_content = [];
+            FOR sub IN titresults; titresults_content.push(sub.textContent); END;
+        args.title = titresults_content.join(" ");
+        # Avoid ugly trailing syntax on brief titles
+        args.title = args.title | replace('[:;/]$', '');
+
+        # Provide correct spacing between the subfields
+        titsubs = xml.findnodes('//*[@tag="245"]/*[@code]');
+        titsubs_content = [];
+            FOR sub IN titsubs; titsubs_content.push(sub.textContent); END;
+        args.title_extended = titsubs_content.join(" ");
+
+        args.publishers = [];
+        FOR sub IN xml.findnodes('//*[@tag="260"]/*[@code="b"]');
+            args.publishers.push(sub.textContent);
+        END;
+        args.publisher = (args.publishers.size) ? args.publishers.0 : '';
+
+        args.pubdates = [];
+        FOR sub IN xml.findnodes('//*[@tag="260"]/*[@code="c"]');
+            args.pubdates.push(sub.textContent);
+        END;
+        args.pubdate = (args.pubdates.size) ? args.pubdates.0 : '';
+
+        args.summaries = [];
+        FOR sub IN xml.findnodes('//*[@tag="520"]/*[@code="a"]');
+            args.summaries.push(sub.textContent);
+        END;
+        args.summary = (args.summary.size) ? args.summary.0 : '';
+
+        args.editions = [];
+        ed_hunt = xml.findnodes('//*[@tag="250"]/*[@code="a"]') &&
+            xml.findnodes('//*[@tag="534"]/*[@code="b"]') &&
+            xml.findnodes('//*[@tag="775"]/*[@code="b"]');
+        FOR sub IN ed_hunt;
+            args.editions.push(sub.textContent);
+        END;
+        args.edition = (args.editions.size) ? args.editions.0 : '';
+
+        phys_content = [];
+        FOR sub IN xml.findnodes(
+            '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]'
+        );
+            phys_content.push(sub.textContent);
+        END;
+        args.phys_desc = phys_content.join(" ");
+
+        args.contents_list = [];
+        FOR sub IN xml.findnodes('//*[@tag="505"]');
+            args.contents_list.push(sub.textContent);
+        END;
+        args.contents = args.contents_list.join(" ");
+        args.content = (args.contents.size) ? args.contents.0 : '';
+
+        # MARC Callnumber
+        args.marc_cns = [];
+        FOR sub IN xml.findnodes('//*[@tag="092" or @tag="099"]/*');
+            args.marc_cns.push(sub.textContent);
+        END;
+        args.marc_cn = (args.marc_cns.size ) ? args.marc_cns.0 : '';
+            
+
+        # clean up the ISBN
+        args.isbn_clean = args.isbns.0.replace('\ .*', '');
+
+        # Extract the 856 URLs that are not otherwise represented by asset.uri's
+        args.online_res = [];
+        FOR node IN xml.findnodes('//*[@tag="856" and @ind1="4" and (@ind2="0" or @ind2="1")]');
+            IF node.findnodes('./*[@code="9" or @code="w" or @code="n"]'); NEXT; END; # asset.uri's
+            label = node.findnodes('./*[@code="y"]');
+            notes = node.findnodes('./*[@code="z" or @code="3"]');
+            FOR href IN node.findnodes('./*[@code="u"]');
+                NEXT UNLESS href;
+                # it's possible for multiple $u's to exist within 1 856 tag.
+                # in that case, honor the label/notes data for the first $u, but
+                # leave any subsequent $u's as unadorned href's. 
+                # use href/link/note keys to be consistent with args.uri's
+                args.online_res.push({
+                    href => href.textContent, 
+                    link => (loop.first AND label) ? label.textContent : href.textContent,
+                    note => (loop.first) ? notes.textContent : ''
+                });
+            END;
+        END;
+        args.holdings = [];
+        args.uris = [];
+        args.issns = [];
+        args.resolver_isbns = [];
+        args.resolver_issns = [];
+
+        # we use $9 of ISBN and ISSN as a flag for e-version
+        FOR resolver_isbn IN xml.findnodes('//*[@tag="020"]/*[@code="9"]');
+            IF resolver_isbn.textContent == "SFX" || resolver_isbn.textContent == "CUFTS";
+                my_parent = resolver_isbn.parentNode();
+                FOR resolver_isbn_val IN my_parent.findnodes('./*[@code="a"]');
+                    args.resolver_isbns.push(
+                        resolver_isbn_val.textContent.replace('-', '').replace('\ .*', '')
+                    );
+                END;
+            END;
+        END;
+
+        FOR resolver_issn IN xml.findnodes('//*[@tag="022"]/*[@code="9"]');
+            IF resolver_issn.textContent == "SFX" || resolver_issn.textContent == "CUFTS";
+                my_parent = resolver_issn.parentNode();
+                FOR resolver_issn_val IN my_parent.findnodes('./*[@code="a"]');
+                    args.resolver_issns.push(
+                        resolver_issn_val.textContent.replace('[^\d\-X]', '')
+                    );
+                END;
+            END;
+        END;
+
+        # now snag all issns 
+        FOR rawissn IN xml.findnodes('//*[@tag="022"]/*[@code="a"]');
+            args.issns.push(
+                rawissn.textContent.replace('[^\d\-X]', '')
+            );
+        END;
+
+        FOR volume IN xml.findnodes('//*[local-name()="volumes"]/*[local-name()="volume"]');
+
+            # Check volume visibility - could push this into XPath
+            vol.label = volume.getAttribute('label');
+
+            # Prepend prefix, if any
+            prefix = volume.findnodes('./*[local-name()="call_number_prefix"][@ident!="-1"]');
+            IF prefix.getAttribute('label') != '';
+                vol.label = prefix.getAttribute('label') _ " " _ vol.label;
+            END;
+
+            # Append prefix, if any
+            suffix = volume.findnodes('./*[local-name()="call_number_suffix"][@ident!="-1"]');
+            IF suffix.getAttribute('label') != '';
+                vol.label = vol.label _ " " _ suffix.getAttribute('label');
+            END;
+
+            vol.id = volume.getAttribute('id');
+            NEXT IF volume.getAttribute('opac_visible') == 'false';
+            NEXT IF volume.getAttribute('deleted') == 'true';
+
+            IF vol.label == '##URI##';
+                FOR uri IN volume.findnodes('./*[local-name()="uris"]/*[local-name()="uri"]');
+                    res = {};
+                    res.href = uri.getAttribute('href');
+                    res.link = uri.getAttribute('label');
+                    res.note = uri.getAttribute('use_restriction');
+                    args.uris.push(res);
+                END;
+                NEXT;
+            ELSE;
+                copies = volume.findnodes('./*[local-name()="copies"]/*[local-name()="copy"]');
+                FOR copy IN copies;
+                    parts = copy.findnodes('./*[local-name()="monograph_parts"]/*[local-name()="monograph_part"]');
+                    FOREACH part IN parts;
+                        part_label = part.getAttribute('label');
+                        LAST IF part_label != '';
+                    END;
+                    # Check copy visibility
+                    cp.deleted = copy.getAttribute('deleted');    
+                    cp.visible = copy.getAttribute('opac_visible');
+                    NEXT IF (cp.deleted == 'true' OR cp.visible == 'false');
+
+                    # Iterate through all of the children to determine visibility
+                    FOR node IN cp.childNodes;
+                        NEXT IF cp.visible == 'false';
+                        vis = node.getAttribute('opac_visible');
+                        del = node.getAttribute('deleted');
+                        IF vis == 'false' or del == 'true';
+                            cp.visible = 'false';
+                        END;
+                    END;
+
+                    NEXT IF cp.visible == 'false';
+                    
+                    loc = copy.findnodes('./*[local-name()="location"]');
+                    circlib = copy.findnodes('./*[local-name()="circlib"]');
+                    status = copy.findnodes('./*[local-name()="status"]');
+
+                    holding = {
+                        label => vol.label,
+                        part_label => part_label,
+                        location => loc.textContent,
+                        library => circlib.textContent,
+                        status => status.textContent
+                        barcode => copy.getAttribute('barcode')
+                    };
+                    args.holdings.push(holding);
+                    part_label = '';
+                END;
+            END;
+        END;
+
+        # Extract the copy count summary
+        count_type = (ctx.is_staff) ? 'staff' : 'public';
+
+        # Consortial copy count summary first
+        xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]';
+        args.copy_counts = {};
+        FOR node IN xml.findnodes(xpath);
+            FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit']; 
+                depth = node.getAttribute('depth');
+                args.copy_counts.$depth.$attr = node.getAttribute(attr);
+            END;
+        END;
+        
+        # Get preferred library copy count
+        args.plib_copy_counts = {};
+        count_type = 'pref_lib';
+        xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]';
+        FOR node IN xml.findnodes(xpath);
+            FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit']; 
+                depth = node.getAttribute('depth');
+                args.plib_copy_counts.$depth.$attr = node.getAttribute(attr);
+            END;
+        END;
+
+        # "mattype" == "custom marc format specifier"
+        FOR icon_style IN ['mattype', 'item_type']; 
+            node = xml.findnodes(
+                '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]');
+            IF node AND node.textContent;
+                type = node.textContent;
+                args.format_label = node.getAttribute('coded-value')
+                args.schema.itemtype = schema_typemap.$type;
+                args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ type _ '.png';
+                LAST;
+            END;
+        END;
+
+    END;
+%]
diff --git a/templates_tadlskin/opac/parts/myopac/base.tt2 b/templates_tadlskin/opac/parts/myopac/base.tt2
new file mode 100644 (file)
index 0000000..c433c6a
--- /dev/null
@@ -0,0 +1,36 @@
+[%  WRAPPER "opac/parts/base.tt2" %]
+
+[% myopac_pages = [
+        {url => "main", name => l("Account Summary")},
+        {url => "circs", name => l("Items Checked Out")},
+        {url => "holds", name => l("Holds")},
+        {url => "prefs", name => l("Account Preferences")},
+        {url => "lists", name => l("My Lists")}
+    ];
+    skin_root = "../"
+%]
+    [% INCLUDE "opac/parts/topnav.tt2" %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <div id="content-wrapper">
+        <div id="myopac_tabs">
+            <div id="acct_tabs">
+                [%- FOREACH page IN myopac_pages;
+                    IF page.url == myopac_page;
+                        cls_which = "acct-tab-on";
+                        ctx.page_title = "Your Account - " _ page.name;
+                    ELSE;
+                        cls_which = "acct-tab-off";
+                    END -%]
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/' _ page.url, {}, ['bbid', 'offset', 'limit']) %]"
+                    class="[% cls_which %]">[% page.name; %]</a>
+                [% END %]
+            </div>
+        </div>
+        <div id="main-content">
+            [% content %]
+            <div class="common-full-pad"></div>
+        </div>
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/myopac/main_base.tt2 b/templates_tadlskin/opac/parts/myopac/main_base.tt2
new file mode 100644 (file)
index 0000000..9acb4ce
--- /dev/null
@@ -0,0 +1,100 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+%]
+
+<div id='myopac_summary_div' style="padding:0px;">
+
+    <div style="width:742px;float:left;">
+        <div class="header_middle">[% l('Account Summary') %]</div>
+    </div>
+
+    <!-- fines summary along the right of the page -->
+    [% IF myopac_main_page == "payment_form" OR (
+        !ctx.fines.circulation.size AND !ctx.fines.grocery.size
+    ) %]
+    <div id="myopac_sum_fines_placehold"></div>
+    [% ELSE %]
+    <div id="myopac_sum_fines">
+        <div style="position:absolute;">
+            <div style="position:relative;top:-15px;left:-23px;">
+                <img src="[% ctx.media_prefix %]/images/acct_sum_fines_tl.png" />
+            </div>
+        </div>
+        <div style="position:absolute;">
+            <div style="position:relative;top:-15px;left:172px;">
+                <img src="[% ctx.media_prefix %]/images/acct_sum_fines_tr.png" />
+            </div>
+        </div>
+        <div style="position:absolute;">
+            <div style="position:relative;top:161px;left:-23px;">
+                <img src="[% ctx.media_prefix %]/images/acct_sum_fines_bl.png" />
+            </div>
+        </div>
+        <div style="position:absolute;">
+            <div style="position:relative;top:161px;left:172px;">
+                <img src="[% ctx.media_prefix %]/images/acct_sum_fines_br.png" />
+            </div>
+        </div>
+        [% l('Fines:') %]
+        <span class='[% ctx.user_stats.fines.balance_owed ? "alert" : ""%]'>
+            [% money(ctx.user_stats.fines.balance_owed) %]
+        </span><br />
+        [% IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1 %]
+        <form action="[% ctx.opac_root %]/myopac/main_payment_form" method="GET"><input
+            type="submit" title="[% l('Pay Fines') %]" alt="[% l('Pay Fines') %]"
+            value="[% l('Pay Fines') %]" class="pos-rel-top-5 opac-button" /></form>
+        [% END %]
+    </div>
+    [% END %]
+
+    <div style="width:662px;">
+        <div style="float:left;">
+            <div style="padding:10px 0px;"></div>
+            <div class="acct_sum_row">
+                <table width="100%" cellspacing="0" cellpadding="0">
+                    <tr>
+                        <td>[% l("Items Currently Checked out ([_1])", ctx.user_stats.checkouts.total_out) %]</td>
+                        <td align="right">
+                            <a href="[% mkurl(ctx.opac_root _ '/myopac/circs') %]">[% l("View All") %]</a>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+            <div class="acct_sum_row">
+                <table width="100%" cellspacing="0" cellpadding="0">
+                    <tr>
+                        <td>[% l('Items Currently on Hold ([_1])', ctx.user_stats.holds.total) %]</td>
+                        <td align="right">
+                            <a href="[% mkurl(ctx.opac_root _ '/myopac/holds') %]">[% l('View All') %]</a>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+            <div class="acct_sum_row">
+                <table width="100%" cellspacing="0" cellpadding="0">
+                    <tr>
+                        <td>[% l('Items ready for pickup ([_1])', ctx.user_stats.holds.ready) %]</td>
+                        <td align="right">
+                            <a href="[% mkurl(ctx.opac_root _ '/myopac/holds', {available => 1}) %]">[% l('View All') %]</a>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+        </div>
+    </div>
+    <div class="clear-both"></div>
+    <div id='fines_payments_wrapper'>
+        <div id='acct_fines_tabs'>
+            [% IF myopac_main_page == 'main' %]
+            <a href='#' class="acct-tab-on">[% l("Fines") %]</a>
+            <a href='[% mkurl(ctx.opac_root _ '/myopac/main_payments') %]' class="acct-tab-off">[% l("Payments") %]</a>
+            [% ELSE %]
+            <a href='[% mkurl(ctx.opac_root _ '/myopac/main') %]' class="acct-tab-off">[% l("Fines") %]</a>
+            <a href='#' class="acct-tab-on">[% l("Payments") %]</a>
+            [% END %]
+        </div>
+    </div>
+    [% content %]
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/myopac/main_refund_policy.tt2 b/templates_tadlskin/opac/parts/myopac/main_refund_policy.tt2
new file mode 100644 (file)
index 0000000..0a41658
--- /dev/null
@@ -0,0 +1,18 @@
+<tr>
+    <td colspan="3">
+        <br />
+        [% l('Important! You must have a printed receipt
+              to be eligible for a refund on lost items
+              (regulations allow for no exceptions).')
+        %]
+        <br />
+        <strong>
+        [% l('To ensure your necessary receipt information
+             is not lost, enter your email address above 
+             and a receipt will be emailed to you. Otherwise,
+             make certain you have a printed receipt in hand
+             before closing the payment receipt screen.')
+        %]
+        </strong>
+    </td>
+</tr>
diff --git a/templates_tadlskin/opac/parts/myopac/prefs_base.tt2 b/templates_tadlskin/opac/parts/myopac/prefs_base.tt2
new file mode 100644 (file)
index 0000000..b6a1194
--- /dev/null
@@ -0,0 +1,56 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2"; %]
+
+<div id='myopac_prefs_div'>
+    <div id="acct_prefs_tabs">
+        <div style="float:left;">
+
+        [% IF prefs_page == 'personal' %]
+            <div class="align selected">
+                <a href='#'>[% l("Personal Information") %]</a>
+            </div>
+            <div class="align">
+                <a href='[% mkurl('prefs_notify') %]'>[% l("Notification Preferences") %]</a>
+            </div>
+            <div class="align">
+                <a href='[% mkurl('prefs_settings') %]'>[% l("Search Preferences") %]</a>
+            </div>
+        [% ELSIF prefs_page == 'notify' %]
+            <div class="align">
+                <a href='[% mkurl('prefs') %]'>[% l("Personal Information") %]</a>
+            </div>
+            <div class="align selected">
+                <a href='#'>[% l("Notification Preferences") %]</a>
+            </div>
+            <div class="align" >
+                <a href='[% mkurl('prefs_settings') %]'>[% l("Search Preferences") %]</a>
+            </div>
+        [% ELSE %]
+            <div class="align">
+                <a href='[% mkurl('prefs') %]'>[% l("Personal Information") %]</a>
+            </div>
+            <div class="align">
+                <a href='[% mkurl('prefs_notify') %]'>[% l("Notification Preferences") %]</a>
+            </div>
+            <div class="align selected" >
+                <a href='#'>[% l("Search Preferences") %]</a>
+            </div>
+        [% END %]
+        </div>
+    </div> 
+
+    <div class="clear-both"></div> <br/>
+
+    <div class="header_middle">
+        <span id="acct_prefs_header">[% l('Account Information and Preferences') %]</span>
+        <span class="float-right"> 
+            <a class="hide_me" href="#">[% l('Export List') %]</a><!-- what does this do? -->
+        </span>
+    </div>
+
+    <div class="clear-both normal-height"></div>
+
+[% content; %]
+
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/myopac/prefs_hints.tt2 b/templates_tadlskin/opac/parts/myopac/prefs_hints.tt2
new file mode 100644 (file)
index 0000000..e2fbc6b
--- /dev/null
@@ -0,0 +1,5 @@
+<p>
+    [% l('Ensure your account has a valid email address so that we can notify
+          you about available holds, items that are about to be overdue, and
+          overdue items!') %]
+</p>
diff --git a/templates_tadlskin/opac/parts/org_selector.tt2 b/templates_tadlskin/opac/parts/org_selector.tt2
new file mode 100644 (file)
index 0000000..31ba30d
--- /dev/null
@@ -0,0 +1,105 @@
+[%
+# Org Unit Selector Widget :
+#   INCLUDE build_org_selector id='selector-id' name='selector-name' 
+#       value=org_id show_loc_groups=1/0 can_have_vols_only=1/0
+#
+# NOTE: DO NOT USE PROCESS
+# Use of PROCESS results in internal variables, such as value or org_unit, to "leak" out
+
+BLOCK build_org_selector;
+    node_stack = [{org => org_unit || ctx.aouct_tree || ctx.aou_tree}];
+    inherited_vis = ctx.get_cgf('opac.org_unit.non_inherited_visibility').enabled == 'f';
+
+    IF !name; 
+        name = 'loc';
+        IF show_loc_groups; name = 'locg'; END;
+    END;
+    IF !value;
+        value = ctx.search_ou;
+        IF show_loc_groups; 
+            value = CGI.param('locg') || ctx.search_ou;
+        END;
+    END;
+    %]
+
+    <select [% IF id %] id='[% id %]' [% END %] name='[% name %]'>
+    [% 
+        WHILE node_stack.size > 0; 
+            node = node_stack.pop();
+            org_unit = node.org;
+            loc_grp = node.loc_grp;
+            ou_id = org_unit.id;
+            css_class = '';
+            disabled = '';
+            selected = '';
+            visible = org_unit.opac_visible == 't';
+
+            # org and all children are invisible.
+            NEXT IF !visible AND inherited_vis AND !ctx.is_staff;
+
+            IF !loc_grp; # processing an org unit
+
+                top_loc_groups = [];
+                IF show_loc_groups;
+                    # add the location groups that sort below the child org units
+                    FOR grp IN ctx.copy_location_groups.$ou_id.reverse;
+                        IF grp.top == 't';
+                            top_loc_groups.push(grp);
+                        ELSE;
+                            node_stack.push({org => org_unit, loc_grp => grp});
+                        END;
+                    END;
+                END;
+
+                # add the child org units
+                FOR child IN org_unit.children.reverse;
+                    node_stack.push({org => child});
+                END;
+
+                # add the location groups that sort to the top
+                # above the child org units
+                FOR grp IN top_loc_groups;
+                    node_stack.push({org => org_unit, loc_grp => grp});
+                END;
+
+            END;
+
+            # This org unit is not publicly visible (though its children may be).
+            NEXT UNLESS ctx.is_staff OR visible;
+
+            node_value = ou_id;
+            IF loc_grp;
+                node_value = node_value _ ':' _ loc_grp.id; 
+                css_class = 'class="loc_grp"';
+            ELSE;
+                css_class = 'class="org_unit"';
+            END;
+
+            IF can_have_vols_only AND org_unit.ou_type.can_have_vols != 't';
+                disabled = 'disabled="disabled"';
+            ELSIF node_value == value;
+                selected = 'selected="selected"';
+            END; 
+
+            pad_depth = 0;
+
+            # copy loc groups appear as children of the owning org unit
+            SET pad_depth = pad_depth + 1 IF loc_grp;
+
+            # determine the depth by calculating the distance from the root
+            porg = ctx.get_aou(org_unit.parent_ou);
+            WHILE porg;
+                SET pad_depth = pad_depth + 1 IF porg.opac_visible == 't' OR ctx.is_staff;
+                porg = ctx.get_aou(porg.parent_ou);
+            END;
+
+            pad_depth = pad_depth * 2;
+            display_name = loc_grp ? loc_grp.name : org_unit.name %]
+
+            <option value='[% node_value %]' [% selected %] [% disabled %] [% css_class %]> 
+                [% '&nbsp;' FOR [0..pad_depth]; display_name | html %]
+            </option> 
+
+        [% END %]
+    </select>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/place_hold.tt2 b/templates_tadlskin/opac/parts/place_hold.tt2
new file mode 100644 (file)
index 0000000..ec979e3
--- /dev/null
@@ -0,0 +1,106 @@
+[%  PROCESS "opac/parts/misc_util.tt2";
+    PROCESS "opac/parts/hold_error_messages.tt2";
+%]
+
+<div id='holds_box' class='canvas' style='margin-top: 6px;'>
+    <h1>[% l('Place Hold') %]</h1>
+    <form method="POST">
+        <input type="hidden" name="hold_type" value="[% CGI.param('hold_type') | html %]" />
+        [%  
+            redirect = CGI.param('hold_source_page') || CGI.param('redirect_to') || CGI.referer;
+            # since we have to be logged in to get this far, return to a secure page
+            redirect = redirect.replace('^http:', 'https:') 
+        %]
+        <input type="hidden" name="redirect_to" value="[% redirect | html %]" />
+
+        [% IF ctx.is_staff %]
+        <p class="staff-hold">
+            <input type="radio" id="hold_usr_is_requestor_not"
+                onchange="staff_hold_usr_input_disabler(this);"
+                name="hold_usr_is_requestor" value="0"
+                />
+            <label for="hold_usr_is_requestor_not">
+                [% l("Place hold for patron by barcode:") %]
+            </label>
+            <input type="text" name="hold_usr" id="hold_usr_input" onchange="staff_hold_usr_barcode_changed();" /><br />
+            <input type="hidden" id="staff_barcode" value="[% ctx.staff_recipient.card.barcode | html %]"/>
+            <span>
+                <input type="radio" id="hold_usr_is_requestor"
+                    onchange="staff_hold_usr_input_disabler(this);"
+                    name="hold_usr_is_requestor" value="1" />
+                <label for="hold_usr_is_requestor">
+                    [% l("Place this hold for me ([_1] [_2])", ctx.user.first_given_name, ctx.user.family_name) | html %]
+                </label>
+            </span>
+        </p>
+        [% END %]
+
+        <!-- loop through the holds and display status of request where appropriate -->
+        <table id='hold-items-list'>
+        [% FOR hdata IN ctx.hold_data;
+            attrs = {marc_xml => hdata.marc_xml};
+            PROCESS get_marc_attrs args=attrs %]
+            <tr>
+                <td>
+                    <input type="hidden" name="hold_target" value="[% hdata.target.id | html %]" />
+                    <div class='hold-items-list-title'>[% attrs.title_extended | html %]</div>
+                    [% IF hdata.parts %]
+                        [% IF hdata.parts.size > 0 %]
+                        <div style='padding-left: 10px'>
+                            <span>[% hdata.part_required ? l('Select a Part:') : l('Select a Part (optional):') %]</span>
+                            <select name='part'>
+                                [% IF !hdata.part_required %]
+                                <option selected='selected' value=''>[% l('- All Parts -') %]</option>
+                                [% END %]
+                                [% FOR part IN hdata.parts %]
+                                <option value='[% part.id %]'>[% part.label | html %]</option>
+                                [% END %]
+                            </select>
+                        </div>
+                        [% ELSE %]
+                        <input type='hidden' name='part' value=''/>
+                        [% END %]
+                    [% END %]
+                </td>
+            </tr>
+        [% END %]
+        </table>
+
+        <p>
+            [% l('Pickup location:') %]
+            [% PROCESS "opac/parts/org_selector.tt2";
+                INCLUDE build_org_selector name='pickup_lib' value=ctx.default_pickup_lib id='pickup_lib' can_have_vols_only=1 %]
+        </p>
+        <p>
+            [% l('Notify when hold is ready for pickup?') %]
+            <blockquote>
+                <input type="checkbox" name="email_notify" value="t"
+                    [% IF ctx.default_email_notify %]checked="checked"[% END %]/>
+                    [% l('Yes, by Email') %]<br/>
+                <input type="checkbox" name="phone_notify_checkbox"
+                    [% IF ctx.default_phone_notify %]checked="checked"[% END %]/>
+                    [% l('Yes, by Phone') %]<br/>
+                <blockquote>
+                    [% l('Phone Number:') %]<input type="text" name="phone_notify" [% setting = 'opac.default_phone';
+                    IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]'
+                    [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [% END %]/>
+                </blockquote>
+                [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
+                <input type="checkbox" name="sms_notify_checkbox"
+                    [% IF ctx.default_sms_notify %]checked="checked"[% END %]/>
+                    [% l('Yes, by Text Messaging') %]<br/>
+                <blockquote>
+                    [% INCLUDE "opac/parts/sms_carrier_selector.tt2" %]<br/>
+                    [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]<br/>
+                </blockquote>
+                [% END %]
+            </blockquote>
+        </p>
+        <input type="submit" name="submit" value="[% l('Submit') %]" title="[% l('Submit') %]"
+            alt="[% l('Submit') %]" class="opac-button" />
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+        <input type="reset" name="cancel" onclick="javascript:history.go(-1);"
+            value="[% l('Cancel') %]" id="holds_cancel" class="opac-button" />
+    </form>
+</div>
+
diff --git a/templates_tadlskin/opac/parts/place_hold_result.tt2 b/templates_tadlskin/opac/parts/place_hold_result.tt2
new file mode 100644 (file)
index 0000000..6504906
--- /dev/null
@@ -0,0 +1,118 @@
+[%  PROCESS "opac/parts/misc_util.tt2";
+    PROCESS "opac/parts/hold_error_messages.tt2";
+    override_possible = 0;
+    any_failures = 0;
+%]
+
+<!-- TODO: CSS for big/strong-->
+
+<div id='holds_box' class='canvas' style='margin-top: 6px;'>
+    <h1>[% l('Place Hold') %]</h1>
+
+    <form method="POST">
+        <input type="hidden" type="name" name="override" value="1" />
+        [% FOR k IN ctx.orig_params.keys %]
+        <input type="hidden" name="[% k %]" value="[% ctx.orig_params.$k | html %]" />
+        [% END %]
+
+        <table id='hold-items-list'>
+
+        [% FOR hdata IN ctx.hold_data;
+            attrs = {marc_xml => hdata.marc_xml};
+            PROCESS get_marc_attrs args=attrs %]
+            <tr>
+                <td>
+                    [% 
+                        override = 0;
+                        IF hdata.could_override || hdata.hold_local_alert;
+                            override_possible = 1;
+                            override = 1;
+                        END;
+                    %]
+                    <input 
+                        type="checkbox" name="hold_target" value="[% hdata.target.id | html %]"
+                        [% IF override %] checked='checked' [% ELSE %] disabled='disabled' [% END %]/>
+                </td>
+                <td>
+                    [%
+                        title = attrs.title_extended;
+                        IF hdata.selected_part AND hdata.parts AND hdata.parts.size > 0;
+                            FOREACH part IN hdata.parts;
+                                IF hdata.selected_part == part.id;
+                                    title = l('[_1] ([_2])', title, part.label);
+                                END;
+                            END;
+                        END;
+                    %]
+                        
+                    <div class='hold-items-list-title'>[% title | html %]</div>
+                    [% IF hdata.parts %]
+                        <input type='hidden' name='part' value='[% hdata.selected_part || '' %]'/>
+                    [% END %]
+                    <div>
+                        [% IF hdata.hold_success %]
+
+                        <div class='success'>[% l("Hold was successfully placed"); %]</div>
+
+                        [% ELSIF hdata.hold_failed; any_failures = 1 %]
+
+                            <div><big><strong>[% l("Hold was not successfully placed"); %]</strong></big></div>
+                            [% IF hdata.hold_local_block %]
+                                <div>[% l("There is already a copy available at your local library.") %]</div>
+                            [% ELSIF hdata.hold_failed_event || hdata.hold_local_alert %]
+                                <div>
+                                    <span class='hold-items-list-problem'>[% l('Problem:') %]</span>
+                                    <span title="[% hdata.hold_failed_event.textcode | html %]">
+                                        <em>[%
+                                                fail_part_key = hdata.hold_failed_event.payload.fail_part;
+                                                event_key = hdata.hold_failed_event.textcode;
+
+                                                # display:
+                                                (hdata.age_protect ?
+                                                    l("All available copies are temporarily unavailable at your pickup library. Placing this hold could result in longer wait times.") :
+                                                    FAIL_PART_MSG_MAP.$fail_part_key ||
+                                                    EVENT_MSG_MAP.$event_key ||
+                                                    l(hdata.hold_failed_event.desc) ||
+                                                    hdata.hold_failed_event.payload.fail_part ||
+                                                    hdata.hold_failed_event.textcode ||
+                                                    (hdata.hold_local_alert ?
+                                                        l("There is already a copy available at your local library.") :
+                                                        l("Unknown problem"))) | html
+                                            %]</em>
+                                            [% IF event_key == 'PERM_FAILURE' %]
+                                            <div>[% l('Permission: "[_1]"', hdata.hold_failed_event.ilsperm) | html %]</div>
+                                            [% END %]
+                                    </span>
+                                    [% IF hdata.hold_copy_available %]
+                                        <p>[%  l('Find a copy in the shelving location, "[_1]."', locname) | html %]</p>
+                                    [% END %]
+                                </div>
+                            [% END;
+                        END %]
+                    </div>
+                </td>
+            </tr>
+        [% END %]
+        </table>
+        [% IF override_possible %]
+            <br/>
+            <hr/>
+            <div class='big-strong'>
+                [% |l %]You have permission to override some of the failed holds.<br/>  Click Submit to override and place your hold on the selected items.[% END %]
+            </div>
+            <span style='padding-right: 10px;'>
+                <input type="submit" name="submit" value="[% l('Submit') %]"
+                    title="[% l('Submit') %]" alt="[% l('Submit') %]"
+                    class="opac-button" />
+            </span>
+        [% END %]
+        <span>
+        [% IF any_failures OR ctx.general_hold_error %]
+        <a href="[% CGI.param('redirect_to') || CGI.referer | html %]">[% l('Cancel') %]</a>
+        [% ELSE %]
+        <a href="[% CGI.param('redirect_to') || CGI.referer | html %]">[% l('Continue') %]</a>
+        [% END %]
+        </span>
+    </form>
+</div>
+
diff --git a/templates_tadlskin/opac/parts/pref_lib_display.tt2 b/templates_tadlskin/opac/parts/pref_lib_display.tt2
new file mode 100644 (file)
index 0000000..635c766
--- /dev/null
@@ -0,0 +1,7 @@
+[%- IF ctx.pref_ou && ctx.pref_ou != ctx.search_ou; %]
+<span class="preflib">[%
+    l('Preferred library: [_1][_2][_3]', '<b>', ctx.get_aou(ctx.pref_ou).name, '</b>');
+    %]<a href="[% mkurl(ctx.opac_root _ '/myopac/prefs_settings')
+    %]" class="preflib_change" title="[% l("Change preferred library"); %]">[% l('?') %]</a>
+</span>
+[%- END; %]
diff --git a/templates_tadlskin/opac/parts/preserve_params.tt2 b/templates_tadlskin/opac/parts/preserve_params.tt2
new file mode 100644 (file)
index 0000000..3517f58
--- /dev/null
@@ -0,0 +1,9 @@
+[%- 
+UNLESS params;
+    params = ['locg', 'loc', 'query', 'qtype', 'sort'];
+END;
+FOR param IN params;
+    IF CGI.param(param); %]
+    <input type="hidden" name="[% param %]" value="[% CGI.param(param) | html %]" />
+    [%- END;
+END; %]
diff --git a/templates_tadlskin/opac/parts/qtype_selector.tt2 b/templates_tadlskin/opac/parts/qtype_selector.tt2
new file mode 100644 (file)
index 0000000..98567d4
--- /dev/null
@@ -0,0 +1,16 @@
+[%  query_types = [
+    {value => "keyword", label => l("Keyword")},
+    {value => "title", label => l("Title")},
+    {value => "author", label => l("Author")},
+    {value => "subject", label => l("Subject")},
+    {value => "series", label => l("Series")},
+    {value => "id|bibcn", label => l("Bib Call Number")}
+] %]
+<select name="qtype"[% IF id; ' id="'; id ; '"' ; END %]>
+    [%  query_type = query_type || CGI.param('qtype');
+        FOR qt IN query_types -%]
+    <option value='[% qt.value | html %]'[%
+        query_type == qt.value ? ' selected="selected"' : ''
+    %]>[% qt.label | html %]</option>
+    [% END -%]
+</select>
diff --git a/templates_tadlskin/opac/parts/record/authors.tt2 b/templates_tadlskin/opac/parts/record/authors.tt2
new file mode 100644 (file)
index 0000000..4a0419c
--- /dev/null
@@ -0,0 +1,67 @@
+[%-  
+
+authors = [
+    {
+        type => 'author', 
+        label => l('Author'),
+        xpath => '//*[@tag="100"]|//*[@tag="110"]|//*[@tag="111"]'
+    }, {
+        type => 'added', 
+        label => l('Added Author'),
+        xpath => '//*[@tag="700"]|//*[@tag="710"]|//*[@tag="711"]'
+    }, {
+        type => 'credits', 
+        label => l('Credited'),
+        xpath => '//*[@tag="100"]|//*[@tag="110"]|//*[@tag="111"]'
+    }, {
+        type => 'cast', 
+        label => l('Cast'),
+        xpath => '//*[@tag="508"]'
+    }, {
+        type => 'notes', 
+        label => l('Author Notes: '),
+        xpath => '' # Comes from added content...
+    }
+];
+
+BLOCK build_author_links;
+    FOR node IN ctx.marc_xml.findnodes(xpath);
+        term = '';
+        qterm = '';
+        iprop = '';
+        FOR subfield IN node.childNodes;
+            NEXT UNLESS subfield.nodeName == "subfield";
+            code = subfield.getAttribute('code');
+            NEXT UNLESS code.match('[a-z]');
+            sf_raw = subfield.textContent;
+            sf = subfield.textContent | html;
+            term = term _ ' ' _ sf;
+            qterm = qterm _ ' ' _ sf_raw;
+        END;
+        url = mkurl(ctx.opac_root _ '/results', {query => qterm, qtype => 'author'}, ['page', 'expand']);
+        author_type = label | html;
+        
+        # schema.org changes
+        IF type == 'author';
+            iprop = ' itemprop="accountablePerson"';
+        ELSIF type == 'added';
+            iprop = ' itemprop="contributor"';
+        END;
+        '<a href="' _ url _ '"' _ iprop _ '>' _ term.replace('^\s+', '') _ '</a> (' _ author_type _ '). ';
+    END;
+END;
+%]
+
+<div class='rdetail_authors_div'>
+[%- FOREACH author IN authors;
+    NEXT UNLESS author.xpath; 
+    links = PROCESS build_author_links(
+        xpath=author.xpath, label=author.label, type=author.type
+    );
+    IF links.match('\S') %]
+    <span class='rdetail-author-div'>[% links %]</span>
+    [%- END %]
+[%- END %]
+</div>
+
+
diff --git a/templates_tadlskin/opac/parts/record/awards.tt2 b/templates_tadlskin/opac/parts/record/awards.tt2
new file mode 100644 (file)
index 0000000..94c72a2
--- /dev/null
@@ -0,0 +1,32 @@
+<div class='rdetail_extras_div'> 
+    <div style="margin-bottom:20px;"></div>
+
+        <!-- Chilifresh patron reviews -->
+        <strong>[% l('Patron Reviews:') %]</strong>
+        <div style="margin-bottom:20px;">
+            <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
+            <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center" width="100%"></div>
+        </div>
+    
+        <!-- Reviews from added content provider -->
+        [% IF 0 %] 
+        <strong>[% l('Reviews:') %]</strong>
+        <div style="margin-bottom:20px;"></div>
+        [% END %]
+
+        <!-- Novelist suggestions-->
+        [% IF ENV.OILS_NOVELIST_URL %] 
+        <strong>[% l('Similar Books:') %]</strong>
+        <div class='rdetail_extras_div'>
+            <div id="NoveListSelect" class="NoveListSelect">
+                <div id="NoveListAnchor" class="NoveListSelect"></div>
+                <div id="novsuggestions"></div>
+                <div id="nextreads"></div>
+                <div id="novrelatedauthors"></div>
+                <div id="novrelateditems"></div>
+            </div>
+        </div>
+        [% END %]
+    </div>
+</div>
+
diff --git a/templates_tadlskin/opac/parts/record/body.tt2 b/templates_tadlskin/opac/parts/record/body.tt2
new file mode 100644 (file)
index 0000000..183cf16
--- /dev/null
@@ -0,0 +1,15 @@
+[%-  attrs = {marc_xml => ctx.marc_xml};
+    PROCESS "opac/parts/misc_util.tt2";
+    PROCESS get_marc_attrs args=attrs;
+    stop_parms = ['expand','cnoffset'];
+%]
+<div id='canvas_main' class='canvas' itemscope itemtype='[% args.schema.itemtype %]'>
+    [%- INCLUDE "opac/parts/record/navigation.tt2" %]
+    [%- IF ctx.bib_is_dead %]
+    <div id='rdetail_deleted_exp'>
+        [% l("This record has been deleted from the database.  We recommend that you remove this title from any bookbags it may have been added to.") %]
+    </div>
+    [%- END %]
+    [% INCLUDE "opac/parts/record/summary.tt2" %]
+    [%- INCLUDE "opac/parts/record/navigation.tt2" %]
+</div>
diff --git a/templates_tadlskin/opac/parts/record/cnbrowse.tt2 b/templates_tadlskin/opac/parts/record/cnbrowse.tt2
new file mode 100644 (file)
index 0000000..b9498bb
--- /dev/null
@@ -0,0 +1,61 @@
+[% 
+    cnoffset = CGI.param('cnoffset');
+    cnoffset = cnoffset.match('^\d+$') ? cnoffset : 0; # verify cnoffset is a sane value
+%]
+
+<div id='cn_browse' class='cn_browser'>
+    <div id='cn_browse_div'> 
+        <div class='color_4'>
+            <span>[% l("You are now browsing") %]</span>
+            <strong>[% ctx.browsing_ou.name | html %]</strong>
+        </div>
+        <table class='data_grid bookshelf' width='100%'>
+            <thead>
+                <tr>
+                    <td>
+                        <a class='classic_link' 
+                            href="[% mkurl('', {cnoffset => cnoffset - 1}) %]#cnbrowse"><b>[% l("&lt;&lt; Previous Page") %]</b></a>
+                    </td>
+                    <td colspan='1' align='center'>[% l("Shelf Browser") %]</td>
+                    <td>
+                        <a class='classic_link' 
+                            href="[% mkurl('', {cnoffset => cnoffset + 1}) %]#cnbrowse"><b>[% l("Next Page &gt;&gt;") %]</b></a>
+                    </td>
+                </tr>
+            </thead>
+            <tbody>
+            [% tr_open = 0; FOR cn IN ctx.browsed_call_numbers %]
+                [%- IF loop.index % 3 == 0; tr_open = 1 %]
+                <tr class='cn_browse_row'>
+                [% END -%]
+                    <td class='cn_browse_item' width='25%' valign='top'>
+                        [%  rec_attrs = {marc_xml => cn.record.marc};
+                            PROCESS get_marc_attrs args=rec_attrs;
+                            ident = rec_attrs.isbn_clean || rec_attrs.upc;
+                            IF ident %]
+                        <a href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {}, 1) %]"><img height='60' width='50' 
+                            class='cn_browse_info' name='cn_browse_pic' border='0'
+                            src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]" /></a>
+                        [% END %]
+                        <div class='cn_browse_info bold' name='cn_browse_cn'>[% cn.label | html %]</div>
+                        <div class='cn_browse_info'>
+                            <a name='cn_browse_title' class='classic_link' 
+                                href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {}, 1) %]">[% rec_attrs.title | html %]</a>
+                        </div>
+                        [% IF rec_attrs.author %]<div class='cn_browse_info'>
+                            <a name='cn_browse_author' class='classic_link'
+                                href="[%-
+                                    authorquery = rec_attrs.author | replace('[,\.:;]', '');
+                                    mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, 1)
+                                    -%]">[% rec_attrs.author | html %]</a>
+                        </div>[% END %]
+                        <div class='cn_browse_info' name='cn_browse_lib'>[% cn.owning_lib.name | html %]</div>
+                    </td>
+                [% IF loop.index % 3 == 2; tr_open = 0 %]
+                </tr>
+                [% END %]
+            [% END; IF tr_open %]</tr>[% END %]
+            </tbody>
+        </table>
+    </div>
+</div>
diff --git a/templates_tadlskin/opac/parts/record/copy_counts.tt2 b/templates_tadlskin/opac/parts/record/copy_counts.tt2
new file mode 100644 (file)
index 0000000..cd59442
--- /dev/null
@@ -0,0 +1,48 @@
+<span id="rdetail_copy_counts">
+    <h2>[% l('Available copies') %]</h2>
+    <ul>
+    [%- depths = ctx.copy_summary.size;
+        depth = 0;
+        displayed_ous = {};
+        WHILE depth < depths;
+            ou_avail = ctx.copy_summary.$depth.available;
+            ou_id = ctx.copy_summary.$depth.org_unit;
+            cp_org_unit = ctx.get_aou(ou_id);
+            IF cp_org_unit.opac_visible == 'f' AND !ctx.is_staff;
+                depth = depth + 1;
+                NEXT;
+            END;
+            ou_name = cp_org_unit.name;
+            displayed_ous.$ou_name = 1;
+    %]
+    <li>
+    [% l('[quant,_1,copy,copies] at [_2].', ou_avail, ou_name) | html %]
+    [%- this_depth = ctx.get_aou(ou_id).ou_type.depth;
+        IF ou_avail > 0 && this_depth != ctx.copy_depth %]
+    <a href="[% mkurl('', {copy_depth => this_depth}, ['copy_offset']); %]"
+       title="[% l('Show copies at [_1]', ou_name); %]">
+       [%- l('(Show)'); %]</a>
+    [%- END; %]
+    </li>
+    [%- depth = depth + 1;
+        END;
+
+        depth = attrs.plib_copy_counts.size - 1;
+        ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name;
+        ou_id = attrs.plib_copy_counts.$depth.org_unit;
+        UNLESS depth < 0 || displayed_ous.exists(ou_name);
+    %]
+    [%- IF attrs.plib_copy_counts.$depth.count > 0; %]
+    <li class="preferred">[%
+        l('[_1] of [quant,_2,copy,copies] available at [_3].',
+            attrs.plib_copy_counts.$depth.available,
+            attrs.plib_copy_counts.$depth.count,
+            ou_name) | html
+    %] <a href="[% mkurl('', {locg => ou_id}, ['copy_offset']); %]"
+       title="[% l('Show copies at [_1]', ou_name); %]">[%
+       l('(Show preferred library)');
+    %]</a></li>
+    [%- END %]
+    [%- END %]
+    </ul>
+</span>
diff --git a/templates_tadlskin/opac/parts/record/copy_table.tt2 b/templates_tadlskin/opac/parts/record/copy_table.tt2
new file mode 100644 (file)
index 0000000..b806f5c
--- /dev/null
@@ -0,0 +1,183 @@
+[%-
+
+# If being used in serial mode, flatten list of units so that they can be
+# used like one long list of copies without changing so much code below.
+IF serial_holdings;
+    copies = [];
+    FOREACH h IN serial_holdings;
+        units = h.units.slice(0); # copy
+        FOREACH unit IN units;
+            unit.holding_label = h.label;
+        END;
+        copies = copies.merge(units);
+    END;
+END;
+
+FOREACH copy_info IN copies;
+    IF copy_info.call_number_label != '##URI##';
+        has_copies = 'true';
+    END;
+    IF copy_info.part_label != '';
+        has_parts = 'true';
+    END;
+    IF has_parts && has_copies;
+        LAST;
+    END;
+END;
+-%]
+[%- IF has_copies; %]
+<table cellpadding="0" cellspacing="0" border="0" width="100%" id="rdetails_status">
+    <thead>
+        <tr>
+            [% IF serial_holdings -%]
+            <th id='copy_header_holding_label'>[% l("Issue Label") %]</th>
+            [%- ELSE -%]
+            <th id='copy_header_library'>[% l("Location") %]</th>
+            [%- END %]
+            <th id='copy_header_callnmber'>[% l("Call Number") %]</th>
+            [%- IF has_parts == 'true' %]
+            <th id='copy_header_part'>[% l("Part") %]</th>
+            [%- END %]
+            <th id='copy_header_barcode'>[% l("Barcode") %]</th>
+            <th id='copy_header_shelfloc'>[% l("Shelving Location") %]</th>
+            [%- IF ctx.is_staff %]
+            <th id='copy_header_age_hold'>[% l("Age Hold Protection") %]</th>
+            <th id='copy_header_create_date'>[% l("Create Date") %]</th>
+            [%- END %]
+            [%- IF ctx.is_staff OR serial_holdings %]
+            <th id='copy_header_holdable'>[% l("Holdable?") %]</th>
+            [%- END %]
+            <th id='copy_header_status'>[% l("Status") %]</th>
+            <th id='copy_header_due_date'>[% l("Due Date") %]</th>
+        </tr>
+    </thead>
+    <tbody class="copy_details_table">
+        [%- last_cn = 0;
+        FOR copy_info IN copies;
+            callnum = copy_info.call_number_label;
+            NEXT IF callnum == '##URI##';
+
+            callnum_prefix = copy_info.call_number_prefix_label;
+            IF callnum_prefix != "";
+                callnum = callnum_prefix _ " " _ callnum;
+            END;
+
+            callnum_suffix = copy_info.call_number_suffix_label;
+            IF callnum_suffix != "";
+                callnum = callnum  _ " " _ callnum_suffix;
+            END;
+        -%]
+        <tr>
+            [%- IF serial_holdings %]<td header='copy_header_holding_label' class='rdetail-issue-issue'>
+                [%- copy_info.holding_label | html; -%]
+            </td>
+            [%- ELSE %]<td header='copy_header_library'>
+            [%-
+                org_name = ctx.get_aou(copy_info.circ_lib).name;
+                org_name | html
+            -%]
+            </td>[% END %]
+            <td header='copy_header_callnumber'>[% callnum | html %] [% IF ctx.get_org_setting(CGI.param('loc') OR ctx.aou_tree.id, 'sms.enable') == 1 %](<a href="[% mkurl(ctx.opac_root _ '/sms_cn', {copy_id => copy_info.id}) %]">Text</a>)[% END %]</td>
+            [%- IF has_parts == 'true' %]
+            <td header='copy_header_part'>[% copy_info.part_label | html %]</td>
+            [%- END %]
+            <td header='copy_header_barcode'>
+                [%- IF ctx.is_staff -%]
+                    <a href="javascript:void(0)" onclick="xulG.new_tab(xulG.urls.XUL_COPY_STATUS, {}, {'from_item_details_new': true, 'barcodes': ['[%- copy_info.barcode | html | replace('\'', '\\\'') -%]']})">[% copy_info.barcode | html %]</a>
+                [%- ELSE -%][% copy_info.barcode | html %]
+                [%- END -%]</td>
+            <td header='copy_header_shelfloc'>[% copy_info.copy_location | html %]</td>
+            [%- IF ctx.is_staff %]
+            <td header='copy_header_age_hold'>
+                [% copy_info.age_protect ?
+                    ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
+            </td>
+            <td header='copy_header_date_format'>[% date.format(
+                ctx.parse_datetime(copy_info.create_date),
+                DATE_FORMAT
+            ) %]</td>
+            [% END # is_staff %]
+            [% IF ctx.is_staff OR serial_holdings %]
+            <td header='copy_header_holdable'>[%  # Show copy/volume hold links to staff (without
+                    # checking whether they have permissions to do those).
+                    overall_holdable = (
+                        copy_info.holdable == 't' AND
+                        copy_info.location_holdable == 't' AND
+                        copy_info.status_holdable == 't');
+                    IF overall_holdable;
+                        l("Place on");
+                        IF ctx.is_staff;
+                    %]
+                <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
+                    {hold_target => copy_info.id, hold_type => 'C', hold_source_page => mkurl()}) %]">[% l("copy") %]</a>
+                [%-      IF copy_info.call_number != last_cn;
+                            last_cn = copy_info.call_number;
+                            l(" / "); %]
+                <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
+                    {hold_target => copy_info.call_number, hold_type => 'V', hold_source_page => mkurl()}) %]">[% l("volume") %]</a>
+                [%-      END;
+                         IF serial_holdings;
+                            l(" / ");
+                         END;
+                        END;
+                        IF serial_holdings;
+                %]
+                <a class="rdetail-issue-place-hold"
+                    href="[% mkurl(ctx.opac_root _ '/place_hold', {
+                    hold_target => copy_info.issuance, hold_type => 'I',
+                    hold_source_page => mkurl()
+                }) %]">[% l("issue") %]</a>[%-
+                        END;
+                    ELSE;
+                        l("No");
+                    END %]</td>
+            [%- END %]
+            <td header='copy_header_status'>[% copy_info.copy_status | html %]</td>
+            <td header='due_date'>[%
+                IF copy_info.due_date;
+                    date.format(
+                        ctx.parse_datetime(copy_info.due_date),
+                        DATE_FORMAT
+                    );
+                ELSE;
+                    '-';
+                END %]</td>
+        </tr>
+        [%- END %]
+        <tr>
+        [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
+            new_offset = ctx.copy_offset - ctx.copy_limit;
+            IF new_offset < 0; new_offset = 0; END %]
+            <td>
+                <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
+                    l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
+            </td>
+        [%- END %]
+        [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings %]
+            <td>
+                <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
+                    l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
+            </td>
+        [%- END %]
+        </tr>
+        [% IF NOT serial_holdings -%]
+        <tr>
+            <td>
+                [%- more_copies_limit = 50 %] [%# TODO: config %]
+                [%- IF  ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit %]
+                    <div class="rdetail_show_copies">
+                        <img src="[% ctx.media_prefix %]/images/plus_sign.png" />
+                        <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
+                    </div>
+                [%- ELSIF ctx.copy_limit == more_copies_limit %]
+                    <div  class="rdetail_show_copies">
+                        <img src="[% ctx.media_prefix %]/images/minus_sign.png" />
+                        <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
+                    </div>
+                [%- END %]
+            </td>
+        </tr>
+        [%- END %]
+    </tbody>
+</table>
+[% END; %]
diff --git a/templates_tadlskin/opac/parts/record/extras.tt2 b/templates_tadlskin/opac/parts/record/extras.tt2
new file mode 100644 (file)
index 0000000..4a473c3
--- /dev/null
@@ -0,0 +1,69 @@
+<div>
+    <div id='rdetail_extras_div' style='width: 100%;'> 
+
+        [%  # Hidden extras are not yet implemented.  Some may require JS
+
+        # Let's see if we should hide the content cafe / simple summary content
+        hide_summary = 1;
+        IF attrs.summary.0; hide_summary = 0; ELSE;
+            # Expose content cafe if it's reasonable to do so.
+            # This approach only works when using embedded content cafe.
+            IF ENV.OILS_CONTENT_CAFE_USER; 
+                ident = attrs.isbn_clean || attrs.upc; 
+                IF ident; hide_summary = 0; END;
+            END;
+        END;
+
+        extras = [
+            {name => 'summaryplus',  label => l('Summaries &amp; More'), hide => hide_summary}, 
+            {name => 'contents',  label => l('Contents'), hide => !attrs.contents},
+            {name => 'annotation', label => l('Annotation'), hide => 1}, 
+            {name => 'awards',  label => l('Awards, Reviews, & Suggested Reads')}, 
+            {name => 'excerpt',  label => l('Excerpt'), hide => 1},
+            {name => 'issues',   label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)},
+            {name => 'preview',  label => l('Preview'), hide => 1}, 
+            {name => 'cnbrowse', label => l('Shelf Browser')},
+            {name => 'marchtml', label => l('MARC Record')}
+        ];
+
+        MACRO tab_is_active(tab) BLOCK;
+            exp_name = 'expand_' _ tab;
+            IF ctx.$exp_name OR ctx.expand_all; 1; END;
+        END;
+
+        FOREACH extra IN extras;
+            IF extra.hide; NEXT; END; 
+            name = extra.name;
+        %]
+        <div class="rdetail_extras">
+            <div class="rdetail_extras_hr"></div>
+            <div class="rdetail_extras_link">
+                [%  
+                    IF tab_is_active(name);
+                        href = mkurl('', {}, ['expand']);
+                        img_url = ctx.media_prefix _ '/images/rdetail_arrow_down.png';
+                    ELSE;
+                        href = mkurl('', {expand => name}) _ '#' _ name; 
+                        img_url = ctx.media_prefix _ '/images/rdetail_arrow.png';
+                    END;
+                %]
+                <a name='[% name %]' href='[% href %]'><img alt='[% extra.label %]' src='[% img_url %]'/></a>
+                <a href='[% href %]' class="rdetail_extras_lbl">[% extra.label %]</a>
+            </div>
+        </div>
+        <div class='rdetail_extras_div'>
+            [%  IF tab_is_active(name);
+                    IF name == 'marchtml';
+                        ctx.marchtml;
+                    ELSIF name == 'contents';
+                        attrs.contents;
+                    ELSE;
+                        # Load the template for the selected extra
+                        INCLUDE "opac/parts/record/${name}.tt2";
+                    END;
+                END; 
+            %]
+        </div>
+        [% END %]
+    </div>
+</div>
diff --git a/templates_tadlskin/opac/parts/record/issues-db.tt2 b/templates_tadlskin/opac/parts/record/issues-db.tt2
new file mode 100644 (file)
index 0000000..2864161
--- /dev/null
@@ -0,0 +1,199 @@
+[%-
+expand_path = CGI.param('sepath') || [];
+expand_path = expand_path.list; # sic
+
+seoffset_list = CGI.param('seoffset') || [];
+seoffset_list = seoffset_list.list; # sic
+
+IF expand_path.size == 0 AND seoffset_list.size == 0;
+    seoffset_list = [0,0]; # compensate for $auto_expand_first; see ML
+END;
+
+selimit = CGI.param('selimit') || 10;
+ght_sepath = [];
+ght_depth = 0;
+
+VIEW grouped_holding_tree;
+    BLOCK list;
+        level_description = item.shift;
+        level_description.caption =
+            level_description.caption.replace('[\(\)]', '');
+
+        '<div class="rdetail-holding-group">';
+        prev_seoffset_list = seoffset_list.slice(0, ght_depth);
+        next_seoffset_list = seoffset_list.slice(0, ght_depth);
+
+        prev_seoffset_list.$ght_depth = prev_seoffset_list.$ght_depth - selimit;
+        IF prev_seoffset_list.$ght_depth < 0;
+            prev_seoffset_list.$ght_depth = 0;
+        END;
+
+        has_more = 0;
+        at_deepest_level = 0;
+
+        next_seoffset_list.$ght_depth = next_seoffset_list.$ght_depth + selimit;
+        IF item.0.units;
+            INCLUDE "opac/parts/record/copy_table.tt2" serial_holdings=item;
+            "<hr />";
+
+            at_deepest_level = 1;
+            IF NOT item.last.label;
+                has_more = 1;
+            END;
+        ELSE;
+            FOREACH node IN item;
+                IF NOT node.label;
+                    has_more = 1;
+                    LAST;
+                END;
+
+                IF node.value;
+                    ght_sepath.push(node.value);
+                    new_seoffsets = seoffset_list.slice(0, ght_depth);
+                    new_seoffsets.push(0);
+
+                    expand_link = mkurl(
+                        '', {'sepath' => ght_sepath, 'seoffset' => new_seoffsets},
+                        0, 'issues'
+                    );
+
+                    collapse_sepath = ght_sepath.slice(0, -2);
+                    IF collapse_sepath.size == 0;
+                        collapse_clear_params = ['sepath'];
+                    ELSE;
+                        collapse_clear_params = 0;
+                    END;
+
+                    collapse_link = mkurl(
+                        '', {
+                            'sepath' => collapse_sepath,
+                            'seoffset' => new_seoffsets.slice(0, -2)
+                        }, collapse_clear_params, 'issues'
+                    );
+
+                    "<div class='rdetail-holding-group'>";
+                    IF node.children.size;
+                        # TODO: make images or figure out a CSS trick or
+                        # something. I doubt we can count on all OPAC clients
+                        # having adequate fonts to cover these Unicode glyphs.
+                        "&#x25bc; <a href='"; collapse_link;
+                    ELSE;
+                        "&#x25ba; <a href='"; expand_link;
+                    END;
+                    "'>"; node.label; "</a></div>";
+
+                    IF node.children.size;
+                        ght_depth = ght_depth + 1;
+                        view.print(node.children);
+                        ght_depth = ght_depth - 1;
+                    END;
+
+                    waste = ght_sepath.pop;
+                ELSE;
+                    "<div class='rdetail-holding-group'>"; node.label; "</div>";
+                    at_deepest_level = 1;
+                END;
+            END;
+        END;
+
+        to_clear = 0;
+        new_sepath_end = ght_depth - 1;
+        IF new_sepath_end < 0;
+            to_clear = ['sepath'];
+            new_sepath = [];
+        ELSE;
+            new_sepath = expand_path.slice(0, ght_depth - 1);
+        END;
+
+        # So the "holdings" level of the tree is sorted ascending, while all
+        # the higher levels are sorted descending.  This seems weird until you
+        # look at it.  I dunno. I think it feels right.  It could be changed I
+        # guess.  Anyway, this means we have to be careful about which
+        # paging link we label "earlier" and which one we label "later."
+
+        next_link = ''; prev_link = '';
+        IF has_more;
+            next_link = '<a class="paging" href="' _
+                mkurl('',{seoffset => next_seoffset_list, sepath => new_sepath},to_clear,'issues') _ '">LABEL_HERE</a>&nbsp; ';
+        END;
+        IF seoffset_list.$ght_depth > 0;
+            prev_link = '<a class="paging" href="' _
+                mkurl('',{seoffset => prev_seoffset_list, sepath => new_sepath},to_clear,'issues') _ '">LABEL_HERE</a>&nbsp; ';
+        END;
+
+        IF at_deepest_level;
+            prev_link.replace('LABEL_HERE', '&laquo; ' _ l('Earlier issues'));
+            next_link.replace('LABEL_HERE', l('Later issues') _ ' &raquo;');
+        ELSE;
+            # XXX this is really bad for i18n (notice the sloppy pluralization),
+            # but then the middle layer for serials only knows English names
+            # for things like "month". There's a bigger problem to solve
+            # here...
+            caption = level_description.caption;
+            IF level_description.display_grouping == 'chron';
+                caption = caption _ 's';
+            END;
+            next_link.replace(
+                'LABEL_HERE',
+                '&laquo; ' _ l('Earlier') _ ' ' _ caption
+            );
+            prev_link.replace(
+                'LABEL_HERE',
+                l('Later') _ ' ' _ caption _ ' &raquo;'
+            );
+        END;
+        '</div>';
+    END;
+END;
+
+VIEW holding_summary_tree;
+    BLOCK hash;
+        '<div class="rdetail-holding-group">';
+        ctx.get_aou(item.org_unit).name; "<br />";
+        FOREACH summary IN item.holding_summaries;
+            IF summary.holdings;
+                twisty = '&#x25bc; ';
+                link = mkurl(
+                    '', {},
+                    ['sid','stype','selimit','sepath','seoffset'], 'issues'
+                );
+                link_title = l('Collapse');
+            ELSE;
+                twisty = '&#x25ba; ';
+                link = mkurl(
+                    '', {sid => summary.id, stype => summary.summary_type},
+                    ['selimit','sepath','seoffset'], 'issues'
+                );
+                link_title = l('Expand');
+            END;
+            '<span>'; twisty;
+            '<a href="' _ link _ '" title="' _ link_title _ '">';
+            summary.generated_coverage.join(", ");
+            '</a></span><br />';
+            IF summary.holdings;
+                grouped_holding_tree.print(summary.holdings);
+            END;
+        END;
+        FOREACH child IN item.children;
+            view.print(child);
+        END;
+        '</div>';
+    END;
+END %]
+    <div class="holding-summary-tree">
+    [% holding_summary_tree.print(ctx.holding_summary_tree) %]
+    </div>
+    <div class="holding-summary-tree-pager">
+        [%  slimit = CGI.param('slimit') || 10;
+            soffset = CGI.param('soffset') || 0;
+            soffset_prev = soffset - slimit;
+            IF soffset_prev < 0; soffset_prev = 0; END;
+            soffset_next = soffset + slimit;
+        %]
+        [% IF soffset > 0 %]
+        <a href="[% mkurl('', {soffset => soffset_prev}, ['sid','stype','sepath','selimit','seoffset'], 'issues') %]>[% l('Previous') %]</a>
+        [% END %]
+        [% IF ctx.holding_summary_tree.more %]
+        <a href="[% mkurl('', {soffset => soffset_next}, ['sid','stype','sepath','selimit','seoffset'], 'issues') %]">[% l('Next') %]</a>
+        [% END %]
+    </div>
diff --git a/templates_tadlskin/opac/parts/record/issues-mfhd.tt2 b/templates_tadlskin/opac/parts/record/issues-mfhd.tt2
new file mode 100644 (file)
index 0000000..15b9ab9
--- /dev/null
@@ -0,0 +1,40 @@
+[% IF ctx.mfhd_summaries.size; %]
+    <div class="rdetail-mfhd-holdings">
+        <table><tbody>
+[%
+        mfhd = {
+            basic_holdings = l('Volumes'),
+            basic_holdings_add = l('Additional Volume Information'),
+            supplement_holdings = l('Supplements'),
+            supplement_holdings_add = l('Additional Supplement Information'),
+            index_holdings = l('Indexes'),
+            index_holdings_add = l('Additional Index Information'),
+            online = l('Online'),
+            missing = l('Missing'),
+            incomplete = l('Incomplete'),
+        };
+
+        FOREACH serial IN ctx.mfhd_summaries;
+%]
+            <tr>
+                <td class="rdetail-mfhd-head" colspan="2">[% l('Holdings summary ([_1])', serial.location) %]</td>
+            </tr>
+[%
+            FOREACH type IN mfhd.keys;
+                NEXT UNLESS serial.$type.size;
+%]
+            <tr>
+                <td class="rdetail-mfhd-type">[% mfhd.$type %]</td>
+                <td class="rdetail-mfhd-contents">[%
+                    FOR thing IN serial.$type;
+                        thing.join(", ");
+                    END %]</td>
+            </tr>
+        [% END %]
+            <tr>
+                <td class="rdetail-mfhd-foot" colspan="2"> </td>
+            </tr>
+    [% END %]
+        </tbody></table>
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/record/issues.tt2 b/templates_tadlskin/opac/parts/record/issues.tt2
new file mode 100644 (file)
index 0000000..998e2d6
--- /dev/null
@@ -0,0 +1,8 @@
+<div class='rdetail_extras_div'>
+    [%
+        IF ctx.holding_summary_tree;
+            INCLUDE 'opac/parts/record/issues-db.tt2'; # "new" serials holdings
+        END;
+    %]
+    [% INCLUDE 'opac/parts/record/issues-mfhd.tt2' # mfhd-based "classic" serials %]
+</div>
diff --git a/templates_tadlskin/opac/parts/record/navigation.tt2 b/templates_tadlskin/opac/parts/record/navigation.tt2
new file mode 100644 (file)
index 0000000..29b1106
--- /dev/null
@@ -0,0 +1,38 @@
+[% IF ctx.search_result_index >= 0 %]
+<div class="rdetail_header">
+    <span class="rdetail_results">
+        <a href='[% mkurl(ctx.opac_root _ '/results', {}, stop_parms); %]'>[% l('&#9668; Search Results') %]</a>
+        <span class="rdetail_result_count">
+            [% l('Showing Item [_1] of [_2]', ctx.search_result_index + 1, ctx.hit_count) %]
+        </span>
+    </span>
+    [%- INCLUDE "opac/parts/pref_lib_display.tt2" %]
+    <div class="rdetail_result_nav">
+        [%
+            IF ctx.prev_search_record;
+                prev_args = {};
+                IF ctx.search_page > 0 AND 
+                        ctx.search_result_index % ((ctx.page_size * ctx.search_page)) == 0; # first record in the page
+                    prev_args.page = ctx.search_page - 1;
+                END;
+                ctx.prev_rec_url = mkurl(ctx.prev_search_record, prev_args, stop_parms);
+        %]
+        <a class='np_nav_link classic_link' title='[% l("Previous Record") %]'
+            href='[% ctx.prev_rec_url %]'>&#9668; [% l('Previous') %]</a>
+        [% END %]
+
+        [% 
+            IF ctx.next_search_record;
+                next_args = {};
+                IF (ctx.page_size * (ctx.search_page + 1)) == ctx.search_result_index + 1;
+                    next_args.page = ctx.search_page + 1;
+                END;
+                ctx.next_rec_url = mkurl(ctx.next_search_record, next_args, stop_parms);
+        %]
+        <a class='np_nav_link classic_link' title='[% l("Next Record") %]'
+            href='[% ctx.next_rec_url %]'>[% l('Next') %] &#9658;</a>
+        [% END %]
+
+    </div>
+</div>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/record/refworks.tt2 b/templates_tadlskin/opac/parts/record/refworks.tt2
new file mode 100644 (file)
index 0000000..ed02a74
--- /dev/null
@@ -0,0 +1,20 @@
+[%
+    # Default to the root of the org unit tree in the absence of a specific library
+    loc = ctx.search_ou;
+
+    # Get the full name of the library
+    ou_name = ctx.get_aou(loc).name | uri;
+
+    # Generate the gross RefWorks URL, based on parameters from config.tt2
+    rw_uri = ctx.refworks.url _ 
+        '/express/expressimport.asp?vendor=' _
+        ou_name _
+        '&filter=MARC+Format&database=All+MARC+Formats&' _
+        'encoding=65001&url=http%3A%2F%2F' _
+        CGI.server_name _ 
+        '/opac/extras/supercat/marctxt/record/' _ 
+        ctx.bre_id;
+%]
+<div class="rdetail_refworks">
+    <a href="[% rw_uri %]">[% l('Export to RefWorks') %]</a>
+</div>
diff --git a/templates_tadlskin/opac/parts/record/series.tt2 b/templates_tadlskin/opac/parts/record/series.tt2
new file mode 100644 (file)
index 0000000..4695768
--- /dev/null
@@ -0,0 +1,32 @@
+[% 
+    series_tags = ['440', '490', '800', '810', '811', '830', '694']; 
+    loc = ctx.search_ou;
+%]
+
+[% BLOCK render_series;
+    results = [];
+    FOR tag IN series_tags;
+        FOR node IN ctx.marc_xml.findnodes('//*[@tag="' _ tag _ '"]/*');
+            node_uri = node.textContent | uri;
+            node_html = node.textContent | html;
+            IF !loop.first;
+                results.last = result.last _ '<span>&mdash;</span>';
+            END;
+            results.push('<a href="' _ ctx.opac_root 
+                _ '/results?qtype=series&amp;query=' _ node_uri _ '&amp;loc='
+                _ loc _ '">' _ node_html _ '</a>'
+            );
+        END;
+    END; 
+END;
+%]
+
+[%- series_anchors = PROCESS render_series;
+    IF series_anchors.length > 0; %]
+<h2 class='rdetail_related_series'>[% l('Search for related items by series') %]</h2>
+<ul>
+    [%- FOR entry IN series_anchors %]
+    <li class='rdetail_series_value'>[% entry %]</li>
+    [% END %]
+</ul>
+[%- END %]
diff --git a/templates_tadlskin/opac/parts/record/subjects.tt2 b/templates_tadlskin/opac/parts/record/subjects.tt2
new file mode 100644 (file)
index 0000000..52d9ac8
--- /dev/null
@@ -0,0 +1,73 @@
+[% 
+    subjects = [
+        {
+            label => l('Subject: '),
+            xpath => '//*[@tag="600" or @tag="610" or @tag="611" or @tag="630" or @tag="650" or @tag="651"]'
+        }, {
+            label => l('Genre: '),
+            xpath => '//*[@tag="655"]|//*[@tag="659"]'
+        }, {
+            label => l('Topic Heading: '),
+            xpath => '//*[@tag="690"]'
+        }, {
+            label => l('Geographic Setting: '),
+            xpath => '//*[@tag="691"]'
+        }, {
+            label => l('Biographical Subject: '),
+            xpath => '//*[@tag="692"]'
+        }, {
+            label => l('Character Attributes: '),
+            xpath => '//*[@tag="693"]'
+        }, {
+            label => l('Setting: '),
+            xpath => '//*[@tag="698"]'
+        }, {
+            label => l('Time Period: '),
+            xpath => '//*[@tag="699"]'
+        }
+    ];
+
+    BLOCK render_subject;
+        xpath = xpath || '//*[starts-with(@tag,"6")]';
+        FOR node IN ctx.marc_xml.findnodes(xpath);
+            all_terms = [];
+            FOR subfield IN node.childNodes;
+                NEXT UNLESS subfield.nodeName == "subfield";
+                code = subfield.getAttribute('code');
+                NEXT UNLESS code.match('[a-z]');
+                IF code.match('[vxyz]'); " &gt; "; END;
+                # at this point, we actually have a partial term to use.
+                single_term = subfield.textContent | html;
+                all_terms.push(subfield.textContent);
+                total_term = all_terms.join(" ").replace('\s+$', '');
+            %]
+<a href="[% mkurl(ctx.opac_root _ '/results', {qtype=>'subject', query=>total_term}, stop_parms); %]">[% single_term %]</a>
+            [%- END;
+            IF all_terms.size; "<br/>"; END;
+        END;
+    END 
+%]
+
+[%  BLOCK render_all_subjects;
+    FOREACH subj IN subjects;
+        content = PROCESS render_subject(xpath=subj.xpath);
+        IF content.match('\S');
+%]
+        <table class='rdetail_subject'>
+            <tbody>
+                <tr>
+                    <td class='rdetail_subject_type'>[% subj.label %]</td>
+                    <td class='rdetail_subject_value' itemprop='keywords'>[% content %]</td>
+                </tr>
+            </tbody>
+        </table>
+        [%- END; %]
+    [%- END; %]
+[%- END %]
+
+[%-  subject_html = PROCESS render_all_subjects;
+    IF subject_html.length > 0;
+%]
+<h2 class='rdetail_related_subjects'>[% l('Search for related items by subject') %]</h2>
+[%- subject_html %]
+[%- END %]
diff --git a/templates_tadlskin/opac/parts/record/summary.tt2 b/templates_tadlskin/opac/parts/record/summary.tt2
new file mode 100644 (file)
index 0000000..062bf2f
--- /dev/null
@@ -0,0 +1,156 @@
+[%  PROCESS "opac/parts/misc_util.tt2";
+    USE ResolverResolver;
+    ctx.page_title = attrs.title | html
+%]
+<!-- ****************** rdetail_summary.xml ***************************** -->
+<abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% ctx.bre_id %]'></abbr>
+
+[%- IF ctx.refworks.enabled == 'true' %]
+    [% INCLUDE 'opac/parts/record/refworks.tt2' %]
+[%- END %]
+
+<hr />
+
+[%-# This holds the record summary information %]
+<div id="rdetail_summary_header">
+    <div id="rdetail_image_div">
+        [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
+        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/[% ident | uri %]'><img
+            alt="[% l('Image of item') %]" id='rdetail_image'
+            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/[% ident | uri %]' /></a>
+        [% END %]
+        <br />
+    </div>
+
+    <div id="rdetail_actions_div">
+        <div class="rdetail_aux_utils place_hold">
+            <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
+                {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
+            class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
+            class="place_hold">[% l('Place Hold') %]</span></a>
+        </div>
+        <div class="rdetail_aux_utils toggle_list">
+        [%-  
+            operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
+            label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
+        %]
+            <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec">
+                <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
+                [% label %]
+            </a>
+        </div>
+        <div class="rdetail_aux_utils">
+            <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
+            <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec">[% l('Print') %]</a> /
+            <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec">[% l('Email') %]</a>
+        </div>
+    </div>
+    <div id='rdetail_title_div'>
+        [%- IF attrs.format_icon %]
+        <div class="format_icon">
+            <img alt="[% attrs.format_label %]" title="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
+        </div>
+        [%- END %]
+        <h1 id='rdetail_title' itemprop="name">[% attrs.title_extended | html %]</h1>
+        [%- INCLUDE "opac/parts/record/authors.tt2" %]
+    </div>
+</div>
+
+[%- IF openurl.enabled == 'true';
+    openurls = [];
+    FOREACH issn IN args.issns;
+        NEXT IF issn == '';
+        openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
+    END;
+    IF openurls.size && openurls.0 != '';
+%]
+    <div id='rdetail_openurl'>
+        <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
+        <table><tbody>
+[%-
+        FOREACH res IN openurls;
+%]
+        <tr>
+            <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name %]</a></td>
+            <td>[% res.target_coverage %]</td>
+        </tr>
+    [%- END %]
+    </tbody></table>
+[%- END %]
+    </div>    
+[%- END %]
+[%- merged_uris = args.uris.merge(args.online_res);
+num_uris = merged_uris.size;
+IF num_uris > 0;
+-%]
+<h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
+<div class="rdetail_uris">
+    [%- IF num_uris > 1 %]<ul>[% END %]
+    [%- FOR uri IN merged_uris %]
+        [%- IF num_uris == 1 %]<p class="rdetail_uri">[% ELSE %]<li class="rdetail_uri">[% END %]
+        <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
+        [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
+    [%- END %]
+    [%- IF num_uris > 1 %]</ul>[% END %]
+</div>
+[%- END %]
+[%- # Hold/copy summary
+    IF ctx.copy_summary.0.count
+%]
+<div id="copy_hold_counts">
+[%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
+    <span id="rdetail_hold_counts">
+        <h2>[% l('Current holds') %]</h2>
+        <p>
+            [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
+                ctx.record_hold_count, ctx.copy_summary.0.count) %]
+        </p>
+    </span>
+[%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
+</div>
+[%- END %]
+
+<h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
+<ul>
+    [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %]
+    <li class='rdetail_isbns'>
+        <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
+        <span class='rdetail_value' itemprop='isbn'>[% isbn | html  %]</span>
+    </li>
+        [%- END %]
+    [%- END %]
+    [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
+    <li class='rdetail_issns'>
+        <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
+        <span class='rdetail_value'>[% issn | html  %]</span>
+    </li>
+        [%- END %]
+    [%- END %]
+    [%- IF attrs.phys_desc %]
+    <li id='rdetail_phys_desc'>
+        <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
+        <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
+    </li>
+    [%- END %]
+    [%- IF attrs.edition %]
+    <li id='rdetail_edition'>
+        <strong class='rdetail_label'>[% l("Edition:") %]</strong>
+        <span class='rdetail_value'>[% attrs.edition | html %]</span>
+    </li>
+    [%- END %]
+    [%- IF attrs.publisher %]
+    <li id='rdetail_publisher'>
+        <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
+        <span class='rdetail_value' itemprop="publisher">[%
+            attrs.publisher | html;
+        %]</span>
+        [% IF attrs.pubdate; %]
+        <span itemprop="datePublished">[% attrs.pubdate | html; %]</span>
+        [% END; %]
+    </li>
+    [%- END %]
+</ul>
+
+[%- INCLUDE "opac/parts/record/subjects.tt2" %]
+[%- INCLUDE "opac/parts/record/series.tt2" %]
+[%- INCLUDE "opac/parts/record/extras.tt2" %]
diff --git a/templates_tadlskin/opac/parts/record/summaryplus.tt2 b/templates_tadlskin/opac/parts/record/summaryplus.tt2
new file mode 100644 (file)
index 0000000..7796213
--- /dev/null
@@ -0,0 +1,19 @@
+<div class='rdetail_extras_div'> 
+    [%  IF attrs.summary %]
+    <div class='rdetail-extras-summary'>
+        <strong>[% l('Summary: ') %]</strong>
+        [% FOR sum IN attrs.summary %]
+            [% IF !loop.first; '<br/>'; END %]
+            <span>[% sum | html %] </span>
+        [% END %]
+    </div>
+    [% END %]
+
+    <!-- Embedded content cafe iframe -->
+    [% ident = attrs.isbn_clean || attrs.upc %]
+    <iframe width="100%" height="400" frameborder="0" 
+        src="[% ctx.proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
+            ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[% ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&amp;Options=Y" >
+    </iframe>
+</div>
+
diff --git a/templates_tadlskin/opac/parts/result/copy_counts.tt2 b/templates_tadlskin/opac/parts/result/copy_counts.tt2
new file mode 100644 (file)
index 0000000..639877e
--- /dev/null
@@ -0,0 +1,36 @@
+[%- depths = attrs.copy_counts.size;
+    depth = 0;
+    displayed_ous = {};
+    WHILE depth < depths;
+        ou_name = ctx.get_aou(attrs.copy_counts.$depth.org_unit).name;
+        displayed_ous.$ou_name = 1;
+        IF attrs.copy_counts.$depth.count > 0;
+%]
+<div class="result_count">
+[% IF ctx.get_aou(attrs.copy_counts.$depth.org_unit).opac_visible == 't' AND !ctx.is_staff %]
+    [% l('[_1] of [quant,_2,copy,copies] available at [_3].',
+        attrs.copy_counts.$depth.available,
+        attrs.copy_counts.$depth.count,
+        ou_name) | html
+    %]
+[% END %]
+</div>
+[%-     END;
+    depth = depth + 1;
+    END;
+
+    depth = attrs.plib_copy_counts.size - 1;
+    ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name;
+    UNLESS displayed_ous.exists(ou_name);
+    
+%]
+[%- IF attrs.plib_copy_counts.$depth.count > 0; %]
+<div class="result_count preferred">[%
+     l('[_1] of [quant,_2,copy,copies] available at [_3].',
+        attrs.plib_copy_counts.$depth.available,
+        attrs.plib_copy_counts.$depth.count,
+        ou_name) | html
+    %]
+</div>
+[%- END %]
+[%- END %]
diff --git a/templates_tadlskin/opac/parts/result/facets.tt2 b/templates_tadlskin/opac/parts/result/facets.tt2
new file mode 100644 (file)
index 0000000..dd27dd9
--- /dev/null
@@ -0,0 +1,129 @@
+<div class="facet_box_wrapper">
+[% 
+
+close_facets = CGI.param('close_facet') || [];
+selected_facets = CGI.param('facet') || [];
+
+# sorted list of search facets
+sorted_facets = [];
+
+IF facet.display;
+
+    # facet display configuration present.  Traverse the 
+    # configuration lists, find the matching facets from 
+    # search facet data, and append them to the sorted 
+    # list of facets.
+
+    FOR display_chunk IN facet.display;
+        FOR display_field IN display_chunk.facet_order;
+            # find the matching facet in the facet data
+            FOR facet IN ctx.search_facets.values;
+                IF facet.cmf.field_class == display_chunk.facet_class 
+                        AND facet.cmf.name == display_field;
+                    sorted_facets.push(facet);
+                END;
+            END;
+        END;
+    END;
+
+ELSE; 
+
+    # No facet display configuration is present.
+    # show all facets, sorted by name.
+
+    # collect facet type labels for easier sorting
+    labels = []; 
+    FOR facet IN ctx.search_facets.values;
+        labels.push(facet.cmf.label);
+    END;
+    
+    FOR facet_label IN labels.sort;
+        FOR facet IN ctx.search_facets.values;
+            IF facet.cmf.label == facet_label;
+                sorted_facets.push(facet);
+            END;
+        END;
+    END;
+END;
+
+FOR facet IN sorted_facets;
+    fclass = facet.cmf.field_class;
+    fname = facet.cmf.name;
+    close_key = fclass _ fname %]
+
+    <div class="facet_box_temp">
+        <div class="header">
+            <span class="button">
+
+                [% IF close_facets.grep(close_key).0;
+                    new_close = [];
+                    FOR fct IN close_facets;
+                        IF fct != close_key;
+                            new_close.push(fct);
+                        END;
+                    END;
+                    expand_url = mkurl('', {close_facet => new_close});
+                    IF new_close.size == 0;
+                        expand_url  = mkurl('', {}, ['close_facet']);
+                    END;
+                %]
+                    <a href="[% expand_url %]"><img 
+                        src="[% ctx.media_prefix %]/images/adv_search_plus_btn.png" alt="[% l('Expand') %]" /></a>
+                [% ELSE %]
+                    <a href="[% mkurl('', {close_facet => close_facets.merge([close_key])}) %]"><img 
+                        src="[% ctx.media_prefix %]/images/adv_search_minus_btn.png" alt="[% l('Collapse') %]" /></a>
+                [% END %]
+            </span>
+            <div class="title">[% facet.cmf.label %]</div>
+        </div>
+        [% IF !close_facets.grep(close_key).0 %]
+        <div class="box_wrapper">
+            <div class="box">
+            [% FOR facet_data IN facet.data;
+                display_value = facet_data.value | html;
+                param_string = fclass _ '|' _ fname _ '[' _ facet_data.value _ ']';
+                new_facets = [];
+                this_selected = 0;
+                FOR selected IN selected_facets;
+                    IF selected == param_string; 
+                        this_selected = 1; 
+                    ELSE;
+                        new_facets.push(selected);
+                    END;
+                END;
+                IF this_selected;
+                    # This facet is already selected by the user. 
+                    # Link removes the facet from the set of selected facets.
+                %] 
+                    <div class="facet_template facet_template_selected">
+                        <div class="facet">
+                            [% IF new_facets.size == 0 %]
+                            <a href="[% mkurl('', {}, ['facet']) %]">[% display_value %]</a>
+                            [% ELSE %]
+                            <a href="[% mkurl('', {facet => new_facets}) %]">[% display_value %]</a>
+                            [% END %]
+                        </div>
+                        <div class="count">([% facet_data.count %])</div>
+                        <div class="clear">&nbsp;</div>
+                    </div>
+                [% 
+                    ELSE;
+                    # This facet is not currently selected.  If selected, 
+                    # append this facet to the list of currently active facets.
+                %]
+                    <div class="facet_template">
+                        <div class="facet">
+                            <a href='[% mkurl('', {facet => selected_facets.merge([param_string])}, ['page']) %]'>[% display_value %]</a>
+                        </div>
+                        <div class="count">([% facet_data.count %])</div>
+                        <div class="clear">&nbsp;</div>
+                    </div>
+                [% END %]
+            [% END %]
+            </div>
+        </div> <!-- box_wrapper -->
+        [% END %]
+    </div> <!-- facet_box_temp -->
+[% END %]
+</div> <!-- facet_box_wrapper -->
+
diff --git a/templates_tadlskin/opac/parts/result/lowhits.tt2 b/templates_tadlskin/opac/parts/result/lowhits.tt2
new file mode 100644 (file)
index 0000000..f6f39b2
--- /dev/null
@@ -0,0 +1,48 @@
+<div>
+    <div id="zero_search_hits">
+        <div class="zero_search_hits_saved">
+            [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
+        </div>
+        <div class="zero_search_hits_main">
+            <p>[% l('Sorry, no entries were found for') %]
+                [% IF is_advanced OR is_special; l('your search'); ELSE %]
+                <q>[% CGI.param('query') | html %]</q>
+                [% END %]
+                [% IF ctx.bookbag;
+                    l('within') %]
+                    <span class="lowhits-bookbag-name">[% ctx.bookbag.name | html %]</span>.
+                [% END %]
+
+            </p>
+        </div>
+        <div style="float:right;width:353px;background:#ccc;padding:10px;margin-top:7px;">
+            [% INCLUDE "opac/parts/result/lowhits_purchase.tt2" %]
+            <p>
+                <strong>Keyword Search Tips</strong><br />
+                Try changing to <strong>Advanced Search</strong>.
+            </p>
+            <p>
+                <strong>Adjacency</strong><br />
+                Multiple words are not searched together as a phrase. They will
+                be found in various parts of the record. To search for a phrase, enclose your
+                search terms in quotation marks.<br />
+                (example:  <strong>&quot;garcia marquez&quot;</strong>)
+            </p>
+            <p>
+                <strong>Truncation</strong><br />
+                Words may be right-hand truncated using an asterisk. Use a single asterisk *
+                to truncate any number of characters.<br />
+                (example: <strong>environment* agency</strong>)
+            </p>
+            <p>
+                <strong>Anchored Searching</strong><br />
+                You may use ^ and $ to indicate "phrase begins with" and
+                "phrase ends with," respectively, within a search phrase
+                enclosed in quotation marks.<br />
+                (examples: <strong>"^harry"</strong> for phrases that begin with
+                the term <em>harry</em>.
+                <strong>"stone$"</strong> for phrases that end in <em>stone</em>.)
+            </p>
+        </div>
+    </div>
+</div>
diff --git a/templates_tadlskin/opac/parts/result/lowhits_purchase.tt2 b/templates_tadlskin/opac/parts/result/lowhits_purchase.tt2
new file mode 100644 (file)
index 0000000..ff34338
--- /dev/null
@@ -0,0 +1,6 @@
+[%# XXX Is this block generally desired? <p>
+    <strong>Still not finding what you are looking for?</strong><br />
+    Request that your library purchase the material you are looking for by making a
+    <a href="javascript:;">Purchase Request</a><br />
+    <strong>Note:</strong> You must be logged in to make a Purchase Request<br />
+</p> %]
diff --git a/templates_tadlskin/opac/parts/result/paginate.tt2 b/templates_tadlskin/opac/parts/result/paginate.tt2
new file mode 100644 (file)
index 0000000..edcc817
--- /dev/null
@@ -0,0 +1,56 @@
+[% BLOCK results_count_header %]
+<div class="results_header_nav1">
+    <span class="h1">[% ctx.bookbag ? l('List Contents') : l('Search Results') %]</span>
+    <span nowrap="nowrap" class="result_number">
+                [% |l(ctx.result_start, ctx.result_stop, ctx.hit_count) %]
+                Results <strong>[_1]</strong> - <strong>[_2]</strong> of <strong>[_3]</strong>
+                [% END %]
+                <span style='padding-left: 6px;'>
+                    [% |l(page + 1, page_count) %](page <strong>[_1]</strong> of <strong>[_2]</strong>)[% END %]
+                </span>
+    </span>
+    [%- INCLUDE "opac/parts/pref_lib_display.tt2" %]
+    <span>
+                <span class='start_end_links_span'>
+
+                    [%  class = 'search_page_nav_link';
+                        href = '#';
+                        IF page > 0;
+                            href = mkurl('', {page => page - 1});
+                        ELSE; class = class _ ' invisible'; END;
+                    %]
+                    <a class='[% class %]' href='[% href %]' 
+                        title='[% l("Previous page") %]'><span class="nav_arrow_fix">&#9668;</span> [% l('Previous') %] </a>
+
+                    <span style='padding-left: 11px; padding-right:11px;'>
+                        [%  # show links to 4 previous pages, the current page, and 3 more pages.
+                            added = 0;
+                            pageitr = page - 5; 
+                            IF page_count > 1; # no need to paginate 1 page
+                                WHILE (pageitr = pageitr + 1) < page_count;
+                                    IF pageitr < 0; NEXT; END;
+                                    IF pageitr == page; %]
+                                        <span class='results-paginator-selected'>[% pageitr + 1%]</span>
+                                    [% ELSE %]
+                                        <a href="[% mkurl('', {page => pageitr}) %]">[% pageitr + 1%]</a>
+                                [%  END;
+                                    added = added + 1;
+                                    IF added == 8; LAST; END;
+                                END;
+                            END;
+                        %]
+                    </span>
+
+                    [%  class = 'search_page_nav_link';
+                        href = '#';
+                        IF (page + 1) < page_count;
+                            href = mkurl('', {page => page + 1});
+                        ELSE; class = class _ ' invisible'; END;
+                    %]
+                    <a class='[% class %]' href='[% href %]' 
+                        title='[% l("Next page") %]'> [% l('Next') %] <span class="nav_arrow_fix">&#9658;</span></a>
+                </span>
+    </span>
+</div>
+[% END %]
+
diff --git a/templates_tadlskin/opac/parts/result/table.tt2 b/templates_tadlskin/opac/parts/result/table.tt2
new file mode 100644 (file)
index 0000000..21ccaa4
--- /dev/null
@@ -0,0 +1,274 @@
+[%  PROCESS "opac/parts/misc_util.tt2";
+
+    USE ResolverResolver;
+
+    ctx.result_start = 1 + ctx.page_size * page;
+    ctx.result_stop = ctx.page_size * (page + 1);
+    IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
+
+    result_count = ctx.result_start;
+
+%]
+
+[% PROCESS "opac/parts/result/paginate.tt2" %] 
+[% ctx.results_count_header = PROCESS results_count_header;
+    ctx.results_count_header %]
+
+[% IF ctx.bookbag %]
+<div id="result-bookbag-heading">
+    <div class="result-bookbag-name">[% ctx.bookbag.name | html %]</div>
+    <div class="result-bookbag-description">[% ctx.bookbag.description | html %]</div>
+</div>
+[% END %]
+<div id="result_table_div">
+            <div class="facet_sidebar">
+                [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
+                [% INCLUDE 'opac/parts/result/facets.tt2' %]
+            </div>
+            <div class="result_block">
+                <table cellpadding="0" cellspacing="0"
+                    border="0" style="margin-top:10px;">
+                    <tbody id="result_table">
+                    [%  FOR rec IN ctx.records;
+                            attrs = {marc_xml => rec.marc_xml};
+                            PROCESS get_marc_attrs args=attrs;
+                            IF CGI.param('detail_record_view');
+                                attrs.title = attrs.title_extended;
+                            END;
+                    -%]
+                        <tr class="result_table_row">
+                                            <td class="results_row_count" name="results_row_count">[%
+                                                    result_count; result_count = result_count + 1
+                                                %].</td>
+                                            <td class='result_table_pic_header'>
+                                                [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
+                                                <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
+                                                        name='item_jacket' class='result_table_pic' width="55"
+                                                        src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]' /></a><br />
+                                                [% END %]
+                                            </td>
+                                            <td class='result_table_title_cell' name='result_table_title_cell'>
+                                                <div class="bold">
+                                                    <a name='record_[% rec.id %]' name='item_title'
+                                                        href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
+                                                        [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]
+                                                        class='search_link'>[% attrs.title | html %]</a>
+                                                </div>
+                                                <div>
+                                                    <div>
+                                                        <em><a title="[% l("Perform an Author Search") %]"
+                                                                name='item_author'
+                                                                href="[%- 
+                                                                    authorquery = attrs.author | replace('[,\.:;]', '');
+                                                                    mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page'])
+                                                                    -%]">[% attrs.author | html %]</a></em>
+                                                        &nbsp;&nbsp;
+                                                        [% attrs.pubdate | html %]
+                                                    </div>
+                                                    <table cellpadding="0" cellspacing="0" border="0"
+                                                        class="results_info_table">
+                                                        [% IF args.holdings.size > 0 %]
+                                                        <tr name='bib_cn_list' class='result_table_title_cell'>
+                                                            <td valign='top'>
+                                                                <strong>[% l('Call number:') %]</strong>
+                                                            </td>
+                                                            <td>[% args.holdings.0.label | html %]</td>
+                                                        </tr>
+                                                        [% END %]
+
+                                                        [% IF CGI.param('detail_record_view') %]
+                                                        <!-- These fields are visible when viewing the results page in 'detailed' mode -->
+
+                                                        [% IF attrs.publisher %]
+                                                            <tr name="results_pub_tr">
+                                                                <td valign="top">
+                                                                    <strong>[% l('Publisher:') %]</strong>
+                                                                </td>
+                                                                <td>[% attrs.publisher | html %]</td>
+                                                            </tr>
+                                                        [% END %]
+                                                        [% IF attrs.isbns.size > 0 %]
+                                                            <tr name="results_isbn_tr">
+                                                                <td valign="top">
+                                                                    <strong>[% l('ISBN:') %]</strong>
+                                                                </td>
+                                                                <td>[% attrs.isbns.0 | html %]</td>
+                                                            </tr>
+                                                        [% END %]
+                                                        [%- IF openurl.enabled == 'true';
+                                                            FOREACH issn IN args.issns;
+                                                                NEXT IF issn == '';
+                                                                res_urls = ResolverResolver.resolve_issn(issn, openurl.baseurl);
+                                                                FOREACH res IN res_urls;
+                                                        %]
+                                                        <tr name="results_issn_tr">
+                                                            <td valign="top">
+                                                                <strong><a href="[% res.target_url %]">
+                                                                [% res.public_name | html %]</a></strong>
+                                                            </td>
+                                                            <td>[% res.target_coverage | html %]</td>
+                                                        </tr>
+                                                                [% END %]
+                                                            [% END %]
+                                                        [% END %]
+
+                                                        [% IF attrs.edition %]
+                                                            <tr name="results_edition_tr">
+                                                                <td valign="top">
+                                                                    <strong>[% l('Edition:') %]</strong>
+                                                                </td>
+                                                                <td>[% attrs.edition | html %]</td>
+                                                            </tr>
+                                                        [% END %]
+                                                        [% IF attrs.phys_desc %]
+                                                            <tr name="results_phys_desc_tr">
+                                                                <td nowrap="nowrap" valign="top">
+                                                                    <strong>[% l('Phys. Desc.:') %]</strong>
+                                                                </td>
+                                                                <td>
+                                                                    [% args.phys_desc | html %]
+                                                                </td>
+                                                            </tr>
+                                                        [% END %]
+                                                        [% FOR uri IN args.uris %]
+                                                            <tr name='bib_uri_list' class='result_table_title_cell'>
+                                                                <td valign='top'>
+                                                                    <strong>[% l('Electronic resource') %]</strong>
+                                                                </td>
+                                                                <td><a href="[% uri.href %]">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
+                                                            </tr>
+                                                            [% END %]
+                                                            [%- IF args.holdings.size > 0;
+                                                                FOREACH copy IN args.holdings;
+                                                                    IF copy.part_label != '';
+                                                                        has_parts = 'true';
+                                                                        LAST;
+                                                                    END;
+                                                                END;
+                                                            %]
+                                                            <tr name='bib_cn_list' class='result_table_title_cell'>
+                                                                <td colspan='2'>
+                                                                    <table class='result_holdings_table'>
+                                                                        <thead><tr>
+                                                                            <th>[% l('Library') %]</th>
+                                                                            <th>[% l('Shelving location') %]</th>
+                                                                            <th>[% l('Call number') %]</th>
+                                                                            [%- IF has_parts == 'true'; %]
+                                                                            <th>[% l('Part') %]</th>
+                                                                            [%- END %]
+                                                                            <th>[% l('Status') %]</th>
+                                                                        </tr></thead>
+                                                                        <tbody>
+                                                                [% FOR copy IN args.holdings %]
+                                                                        <tr>
+                                                                            <td>[% copy.library | html %]</td>
+                                                                            <td>[% copy.location | html %]</td>
+                                                                            <td>[% copy.label | html %]</td>
+                                                                            [%- IF has_parts == 'true'; %]
+                                                                            <td>[% copy.part_label %]</td>
+                                                                            [%- END %]
+                                                                            <td>[% copy.status | html %]</td>
+                                                                        </tr>
+                                                                [% END %]
+                                                                        </tbody>
+                                                                    </table>
+                                                                </td>
+                                                            </tr>
+                                                            [%- has_parts = 'false';
+                                                                END;
+                                                             %]
+                                                        [% END %] <!-- END detail_record_view -->
+                                                    </table>
+                                                    [% PROCESS "opac/parts/result/copy_counts.tt2" %]
+                                                    [% IF rec.user_circulated %]
+                                                    <div class="result_item_circulated">
+                                                        <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>
+                                                        <span>[% l('I have checked this item out before') %]</span>
+                                                    </div>
+                                                    [% END %]
+                                                    [% IF ctx.bookbag;
+                                                        rec_id = rec.id;
+                                                        FOR note IN ctx.bookbag_items_by_bre_id.$rec_id.notes %]
+                                                    <div class="result-bookbag-item-note">
+                                                        [% note.note | html %]
+                                                    </div>
+                                                        [% END %]
+                                                    [% END %]
+                                                </div>
+                                            </td>
+
+                                            <td name='result_table_format_cell' class='result_table_format_cell' width="1">
+
+                                                [% IF attrs.format_icon %]
+                                                <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
+                                                [% END %]
+
+                                                <!-- unAPI link -->
+                                                <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
+
+                                                <!-- Empty span used for creating Google Book Search-->
+                                                <span name="googleBooksLink" class="hide_me">
+                                                    <a style='padding-left: 8px;'
+                                                        class='classic_link hide_me'
+                                                        name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
+                                                </span>
+                                            </td>
+                                            <td nowrap='nowrap' width="1" align="right">
+                                                <div class="result_table_utils_cont">
+                                                    <div class="result_table_utils">
+                                                        <div class="results_aux_utils place_hold"><a
+                                                                href="[% mkurl(ctx.opac_root _ '/place_hold', 
+                                                                    {hold_target => rec.id, hold_type => 'T', hold_source_page => mkurl()}) %]" 
+                                                                    name="place_hold_link" class="no-dec"><img
+                                                                src="[% ctx.media_prefix %]/images/green_check.png"
+                                                                alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
+                                                        </div>
+                                                        <div class="results_aux_utils result_util">
+                                                            [%  
+                                                                operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
+                                                                label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
+                                                                href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
+                                                                        {record => rec.id, anchor => 'record_' _ rec.id}, 1);
+                                                            %]      
+                                                            <a href="[% href %]" class="no-dec">
+                                                                <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
+                                                                [% label %]
+                                                            </a>
+                                                        </div>
+                                                        [% IF ENV.OILS_CONTENT_CAFE_USER %]
+                                                        <div class="results_aux_utils result_util">
+                                                            <a title="[% l('Reviews and More') %]" target='_blank' 
+                                                                href="[% ctx.proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
+                                                                    ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
+                                                                    ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&Options=Y">
+                                                                <img src='[% ctx.media_prefix %]/images/starz.png'/> 
+                                                                <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
+                                                            </a>
+                                                        </div>
+                                                        [% END %]
+                                                    </div>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                        [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
+                                        <tr>
+                                            <td/>
+                                            <td align='center'> <!-- Chilifresh reviews link --> 
+                                                <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td/>
+                                            <td colspan='5'> <!-- Chilifresh reviews panel -->
+                                                <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center"></div>
+                                            </td>
+                                        </tr>
+                                        [%- END %]
+                    [% END %]
+                    </tbody>
+                </table>
+            </div>
+</div>
+<div>
+    [% ctx.results_count_header %]
+</div>
diff --git a/templates_tadlskin/opac/parts/searchbar.tt2 b/templates_tadlskin/opac/parts/searchbar.tt2
new file mode 100644 (file)
index 0000000..f4ee110
--- /dev/null
@@ -0,0 +1,70 @@
+[% PROCESS "opac/parts/org_selector.tt2" %]
+<div id="search-box">    
+    [% UNLESS took_care_of_form -%]
+    <form action="[% ctx.opac_root %]/results" method="GET">
+    [%- END %]
+    <div>
+        <span class="search_catalog_lbl">[% l('Search the Catalog') %]</span>
+        <a href="[% mkurl(ctx.opac_root _ '/advanced') %]"
+            id="home_adv_search_link"><span
+            class="adv_search_font">[% l('Advanced Search') %]</span></a>
+    </div>
+    <div class="searchbar">[%- l('Search ');
+        INCLUDE "opac/parts/coded_value_selector.tt2"
+            attr=["mattype", "item_type"] none_ok=1 none_label=l('All Formats');
+            l(' for ');
+        %]
+        <span class='search_box_wrapper'>
+            <input type="text" id="search_box" name="query"
+                value="[% is_advanced ? ctx.naive_query_scrub(ctx.processed_search_query) : CGI.param('query') | html %]"
+                [%- IF use_autosuggest.enabled == "t" %]
+                dojoType="openils.widget.AutoSuggest" type_selector="'qtype'"
+                submitter="this.textbox.form.submit();"
+                [%-     IF use_autosuggest.value.search('opac_visible') %]
+                store_args='{"org_unit_getter": function() { return [% ctx.search_ou %]; }}'
+                [%-     END # opac_visible -%]
+                [%- ELSE -%]
+                autofocus x-webkit-speech
+                [%- END # autosuggest enabled %] />
+        </span>
+        [%- INCLUDE "opac/parts/qtype_selector.tt2" id="qtype";
+            l(' in '); INCLUDE build_org_selector show_loc_groups=1
+    %]
+    <span>
+        <input id='search-submit-go' type="submit" value="[% l('Search') %]" alt="[% l('Search') %]" class="opac-button"
+            onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
+        <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif' style='height:16px;width:16px;' class='hidden' alt=''/>
+    </span>
+    </div>
+    [% IF ctx.bookbag %]
+    <div id="search-only-bookbag-container">
+        <input type="checkbox" id="search-only-bookbag" name="bookbag"
+            value="[% ctx.bookbag.id | html %]" checked="checked" />
+        <label for="search-only-bookbag">
+            [% l('Search only within the chosen list') %]
+        </label>
+    </div>
+    [% END %]
+    [% IF is_advanced || is_special %]
+    <div>
+        <input type="hidden" name="_adv" value="1" />
+        [% IF ctx.processed_search_query OR (NOT is_advanced AND NOT is_special) %]
+        <input name='page' type='hidden' value="0" />
+        [% END %]
+    </div>
+    [%- END %]
+    [% UNLESS took_care_of_form %]</form>[% END %]
+    [% IF (is_advanced AND NOT is_special) AND CGI.param('qtype') %]
+    <div class="opac-auto-102">
+        [ <a href="[% mkurl(ctx.opac_root _ '/advanced') %]">[%
+            l('Click to Refine Your Original Search')
+        %]</a> ]
+    </div>
+    [% END %]
+    <!--
+    <div id="breadcrumb">
+        <a href="[% ctx.opac_root %]/home">[% l('Catalog Home') %]</a> &gt;
+    </div>
+    -->
+    <div class="clear-both"></div>
+</div>
diff --git a/templates_tadlskin/opac/parts/sms_carrier_selector.tt2 b/templates_tadlskin/opac/parts/sms_carrier_selector.tt2
new file mode 100644 (file)
index 0000000..919ba07
--- /dev/null
@@ -0,0 +1,28 @@
+[%
+    setting = 'opac.default_sms_carrier';
+    IF ctx.user_setting_map.$setting;
+        default_carrier = ctx.user_setting_map.$setting;
+    END;
+
+    temp = ctx.search_csc('active','t');
+
+    # turn the list of objects into a list of hashes to
+    # leverage TT's array.sort('<hashkey>') behavior
+    carriers = [];
+    FOR o IN temp;
+        carriers.push({
+            id => o.id,
+            region => o.region,
+            name => o.name
+        });
+    END;
+%]
+[% IF NOT sms_carrier_hide_label; l('Mobile carrier:'); END; %]
+<select name="sms_carrier">
+    [% FOR carrier IN carriers.sort('name','region') -%]
+    <option value='[% carrier.id | html %]'[%
+        default_carrier == carrier.id ? ' selected="selected"' : ''
+    %]>[% carrier.name | html %] ([% carrier.region | html %])</option>
+    [% END -%]
+</select>
+[% IF NOT sms_carrier_hide_warning; l('Note: carrier charges may apply'); END; %]
diff --git a/templates_tadlskin/opac/parts/sms_number_textbox.tt2 b/templates_tadlskin/opac/parts/sms_number_textbox.tt2
new file mode 100644 (file)
index 0000000..e8d7eb8
--- /dev/null
@@ -0,0 +1,4 @@
+[% IF NOT sms_number_hide_label; l('Mobile number:'); END; %]
+<input type="text" name="sms_notify" [% setting = 'opac.default_sms_notify';
+IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
+[% IF NOT sms_number_hide_hint; l('Hint: use the full 10 digits of your phone #, no spaces, no dashes'); END; %]
diff --git a/templates_tadlskin/opac/parts/staff_saved_searches.tt2 b/templates_tadlskin/opac/parts/staff_saved_searches.tt2
new file mode 100644 (file)
index 0000000..0250651
--- /dev/null
@@ -0,0 +1,26 @@
+[% IF ctx.saved_searches.size %]
+
+    <div class="saved-searches-header">
+        <div class="text">
+            [% l("Recent searches") %]
+        </div>
+        <div class="button">
+            [% IF ctx.saved_searches_expanded %]
+            <a href="[% mkurl('', {'sss_expand' => 0}) %]" title="[% l('Collapse') %]"><img src="[% ctx.media_prefix %]/images/adv_search_minus_btn.png" alt="[% l('Collapse') %]" /></a>
+            [% ELSE %]
+            <a href="[% mkurl('', {'sss_expand' => 1}) %]" title="[% l('Expand') %]"><img src="[% ctx.media_prefix %]/images/adv_search_plus_btn.png" alt="[% l('Expand') %]" /></a>
+            [% END %]
+        </div>
+        <div class="clear">&nbsp;</div>
+    </div>
+    <div class="clear">&nbsp;</div>
+    <div class="saved-searches">
+    [% IF ctx.saved_searches_expanded %]
+        [% FOR s IN ctx.saved_searches %]
+        <ul>
+            <li><a href="[% ctx.opac_root %]/results?query=[% s | uri %]&amp;_adv=1">[% s | html %]</a></li>
+        </ul>
+        [% END %]
+    [% END %]
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/parts/tips.tt2 b/templates_tadlskin/opac/parts/tips.tt2
new file mode 100644 (file)
index 0000000..f4e73ed
--- /dev/null
@@ -0,0 +1,11 @@
+<!-- ****************** tips.xml ***************************** -->
+<div class="hide_me">
+    <div id='tips' class='tips hide_me'>
+        <div class='hide_me'>
+            <span>[% l("Click on a folder icon in the sidebar to access related quick searches") %]</span>
+            <span>[% l("If you don't find what you want try expanding your search using the range selector at the right of the search bar") %]</span>
+        </div>
+        <strong>[% l("Tip:") %]</strong>
+    </div>
+</div>
+<!-- ****************** end: tips.xml ***************************** -->
diff --git a/templates_tadlskin/opac/parts/topnav.tt2 b/templates_tadlskin/opac/parts/topnav.tt2
new file mode 100644 (file)
index 0000000..beaccb8
--- /dev/null
@@ -0,0 +1,60 @@
+[% IF !ctx.is_staff %]
+<div id="header-wrap">
+<div id="header">
+    <div class="float-left">
+        [% INCLUDE "opac/parts/topnav_logo.tt2" %]
+    </div>
+    <div class="float-right">
+        [% IF !ctx.user %]
+        <div id="your-acct-login">
+            <a href="[% mkurl(ctx.opac_root _ '/myopac/main') %]" 
+                class="opac-button opac-button-header" id="home_myopac_link">
+                [% l('Your Account Log in') %]
+            </a>
+        </div>
+        [% ELSE %]
+        <div id="dash_wrapper">
+            <div id="dash_identity">
+                <span id="dash_user">
+                    [%  l('[_1] [_2]', ctx.user.first_given_name, ctx.user.family_name) | html %]
+                </span>
+                <span class="dash_divider">|</span>
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/main') %]" 
+                    class="opac-button">[% l('My Account') %]</a>
+
+                <a href="[% mkurl(ctx.opac_root _ '/logout', {}, 1) %]"
+                    class="opac-button" id="logout_link">[% l('Logout') %]</a>
+            </div>
+            <div id="dashboard">
+                <span class="dash-align">
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/circs')
+                        %]"><span id="dash_checked">[% ctx.user_stats.checkouts.total_out
+                        %]</span> [% l("Checked Out") %]</a>
+                </span>
+                <span class="dash_divider">|</span>
+                <span class="dash-align">
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/holds', {}, ['available'])
+                        %]"><span id="dash_holds">[% ctx.user_stats.holds.total
+                        %]</span> [% l("On Hold") %]</a>
+                </span>
+                <span class="dash_divider">|</span>
+                <span class="dash-align">
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/holds',
+                        {available => 1}) %]"><span id="dash_pickup">[%
+                        ctx.user_stats.holds.ready %]</span> [% l("Ready for Pickup") %]</a>
+                </span>
+                <span class="dash_divider">|</span>
+                <span class="dash-align">
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/main')
+                        %]"><span id="dash_fines">[% money(ctx.user_stats.fines.balance_owed)
+                        %]</span> [% l("Fines") %]</a>
+                </span>
+            </div>
+        </div>
+        [% END %]
+    </div>
+    <div class="common-no-pad"></div>
+</div>
+</div>
+[% END %]
+[% INCLUDE "opac/parts/topnav_links.tt2" %]
diff --git a/templates_tadlskin/opac/parts/topnav_links.tt2 b/templates_tadlskin/opac/parts/topnav_links.tt2
new file mode 100644 (file)
index 0000000..e6f4169
--- /dev/null
@@ -0,0 +1,11 @@
+<div id="gold-links-holder">
+    <div id="gold-links">
+        <div id="header-links">
+            <a href="http://example.com">[% l('Link 1') %]</a>
+            <a href="http://example.com">[% l('Link 2') %]</a>
+            <a href="http://example.com">[% l('Link 3') %]</a>
+            <a href="http://example.com">[% l('Link 4') %]</a>
+            <a href="http://example.com">[% l('Link 5') %]</a>
+        </div>
+    </div>
+</div>
diff --git a/templates_tadlskin/opac/parts/topnav_logo.tt2 b/templates_tadlskin/opac/parts/topnav_logo.tt2
new file mode 100644 (file)
index 0000000..0b55700
--- /dev/null
@@ -0,0 +1,2 @@
+       <div id="topnav_logo"> <a href="http://evergreen-ils.org"><img alt="[% l('Evergreen Logo') %]" 
+            src="[% ctx.media_prefix %]/opac/images/small_logo.png" /></a></div>
diff --git a/templates_tadlskin/opac/password_reset.tt2 b/templates_tadlskin/opac/password_reset.tt2
new file mode 100644 (file)
index 0000000..bbf9418
--- /dev/null
@@ -0,0 +1,71 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l('Library system password reset request form');
+%]
+<div id="search-wrapper">
+    [% INCLUDE "opac/parts/searchbar.tt2" %]
+</div>
+
+[%  
+    uuid = ctx.page_args.0;
+    msg_map = {
+        SUCCESS => l('Password has been reset'),
+        NO_MATCH => l('Passwords did not match. Please try again'),
+        NOT_ACTIVE => l('This was not an active password reset request. Your password has not been reset.'),
+        NOT_STRONG => l('The password you chose was not considered complex enough to protect your account. Your password has not been reset.'),
+        TWO_PASSWORDS => l('Please enter and repeat your new password.'),
+        REQUEST_SUCCESS => l('Your user name or barcode has been submitted for a password reset. ' _ 
+            'If a matching account with an email address is found, you will soon receive an email at that address with further instructions for resetting your password.')
+    }
+%]
+<div id="content-wrapper">
+    <div id="main-content">
+        <br/>
+        <p class='[% ctx.pwreset.style %]'>[% stat = ctx.pwreset.status; msg_map.$stat %]</p>
+        [% IF uuid %]
+            [% IF stat == 'SUCCESS' %]
+                <p><a href='[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]'>[% l('Log in to My Account') %]</a>
+            [% ELSE %]
+            <form method="post">
+                <input type='hidden' name='uuid' value='[% uuid | html %]'/>
+                <table>
+                    <tr>
+                        <td><label for="pwd1">[% l('New password:') %]</label></td>
+                        <td><input type="password" name="pwd1"/></td>
+                    </tr>
+                    <tr>
+                        <td><label for="pwd2">[% l('Re-enter new password:') %]</label></td>
+                        <td><input type="password" name="pwd2"/></td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <button name="submit" class="opac-button" id="submitButton" type="submit">[% l('Submit') %]</button>
+                        </td>
+                    </tr>
+                </table>
+            </form>
+            [% END %]
+        [% ELSIF !ctx.pwreset.status %]
+        <h2>[% l('Please enter your user name or barcode to identify your library account and request a password reset') %]</h2>
+        <form method="post">
+            <table>
+                <tr>
+                    <td><label for="barcode">[% l('Barcode:') %] </label></td>
+                    <td><input type="text" id="barcode" name="barcode"/></td>
+                </tr>
+                <tr>
+                    <td><label for="username">[% l('User name:') %] </label></td>
+                    <td><input type="text" id="username" name="username"/></td>
+                </tr>
+            </table>
+            [% IF ctx.get_org_setting(ctx.physical_loc || ctx.aou_tree.id, 'circ.password_reset_request_requires_matching_email') %]
+            <label for="email">[% l('Email address associated with the account:') %] </label><input type="text" name="email"/></br>
+            [% END %]
+            <button name="submit" id="submitButton" class="opac-button" type="submit">[% l('Submit') %]</button>
+        </form>
+        [% END %]
+    </div>
+</div>
+[% END %]
+
diff --git a/templates_tadlskin/opac/place_hold.tt2 b/templates_tadlskin/opac/place_hold.tt2
new file mode 100644 (file)
index 0000000..3c8d89e
--- /dev/null
@@ -0,0 +1,19 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Place Hold") %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <div id="content-wrapper">
+        <div id="main-content">
+            <div class="common-full-pad"></div>        
+            [% IF ctx.hold_attempt_made %]
+                [% INCLUDE "opac/parts/place_hold_result.tt2" %]
+            [% ELSE %]
+                [% INCLUDE "opac/parts/place_hold.tt2" %]
+            [% END %]
+            <div class="common-full-pad"></div>        
+        </div>
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/record.tt2 b/templates_tadlskin/opac/record.tt2
new file mode 100644 (file)
index 0000000..9503cb8
--- /dev/null
@@ -0,0 +1,23 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Record Detail") %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <br class="clear-both" />
+    <div id="content-wrapper" class="content-wrapper-record-page">
+        [% IF ctx.staff_saved_search_size %]
+        <div id="results-side-bar">
+            <div id="staff-saved-search">
+                [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
+            </div>
+        </div>
+        [% END %]
+        <div id="[% ctx.staff_saved_search_size ? 'main-content-after-bar' : 'main-content' %]">
+            [% INCLUDE "opac/parts/record/body.tt2" %]
+            <div class="common-full-pad"></div>
+        </div>
+        <br class="clear-both" />
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/record/email.tt2 b/templates_tadlskin/opac/record/email.tt2
new file mode 100644 (file)
index 0000000..bafd20a
--- /dev/null
@@ -0,0 +1,21 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/config.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Record Detail") %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <br class="clear-both" />
+    <div id="content-wrapper" class="content-wrapper-record-page">
+        <div id='main-content'>
+            <br/>
+            <h2 class='success'>[% l('Your email has been queued for Delivery.') %]</h2>
+            <br/>
+            <p>[ <a href="[% mkurl(ctx.opac_root  _ '/record/' _ ctx.bre_id) %]">[% l("Back to Record") %]</a> ]</p>
+            <div class="common-full-pad"></div>
+        </div>
+        <br class="clear-both" />
+    </div>
+[% END %]
+
diff --git a/templates_tadlskin/opac/record/print.tt2 b/templates_tadlskin/opac/record/print.tt2
new file mode 100644 (file)
index 0000000..d5d94e6
--- /dev/null
@@ -0,0 +1,27 @@
+[% PROCESS 'opac/parts/header.tt2' %]
+<html>
+    <head>
+        <title>[% l('Print Record') %]</title>
+        <style type="text/css" media="print">.noprint {display: none}</style>
+    </head>
+    <body onload="if (document.getElementById('printable-record')) window.print();">
+        [% IF ctx.printable_record.template_output %]
+        <tt id="printable-record">
+            [% ctx.printable_record.template_output.data %]
+        </tt>
+        [% ELSE %]
+        <div class="noprint print-error">
+            [% l(
+                'Error printing record: [_1]',
+                    (ctx.printable_record.textcode ? ctx.printable_record.textcode _ ' / ' _ ctx.printable_record.desc : 0) ||
+                    ctx.printable_record.error_output.data ||
+                    l('No record data returned from server')
+                ) | html %]
+        </div>
+        [% END %]
+        <div class='noprint'>
+            <hr />
+            <p>[ <a href="[% mkurl(ctx.opac_root  _ '/record/' _ ctx.bre_id) %]">[% l("Back to Record") %]</a> ]</p>
+        </div>
+    </body>
+</html>
diff --git a/templates_tadlskin/opac/results.tt2 b/templates_tadlskin/opac/results.tt2
new file mode 100644 (file)
index 0000000..875a8d2
--- /dev/null
@@ -0,0 +1,77 @@
+[%  PROCESS "opac/parts/header.tt2";
+
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+
+    IF is_advanced || is_special;
+        ctx.page_title = l("Search Results");
+    ELSE;
+        ctx.page_title = l("Search Results: ") _ CGI.param('query') | html;
+    END;
+
+    page = CGI.param('page');
+    page = page.match('^\d+$') ? page : 0; # verify page is a sane value
+
+    page_count = ctx.page_size == 0 ? 1 : POSIX.ceil(ctx.hit_count / ctx.page_size);
+%]
+    <form action="[% ctx.opac_root %]/results" method="GET">
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" took_care_of_form=1 %]
+    </div>
+    <div class="almost-content-wrapper">
+        <div id="results_header_bar">
+            <div id="results_header_inner">
+                <div class="results_header_btns">
+                    <a href="[% mkurl(ctx.opac_root _ '/home') %]">[% l('Another Search') %]</a>
+                </div>
+                <div class="results_header_btns">
+                    <a href="[% mkurl(ctx.opac_root _ '/advanced') %]">[% l('Advanced Search') %]</a>
+                </div>
+                [% IF ctx.mylist.size %]
+                <div class="results_header_btns cached_list_div">
+                    [%- IF ctx.user; %]
+                    <a href="[% mkurl(ctx.opac_root _ '/myopac/lists') %]">[% l('View My List') %]</a>
+                    [%- ELSE %]
+                    <a href="[% mkurl(ctx.opac_root _ '/mylist') %]">[% l('View My List') %]</a>
+                    [%- END %]
+                </div>
+                [% END %]
+                <div class="results_header_div"></div>
+                    <label class="results_header_lbl">[% l('Sort by') %]
+                    [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') submit_on_change=1 %]
+                    </label>
+                    <div class="results_header_div"></div>
+
+                    <div class='results_header_sel' id='simple-detail-view-links'>
+                        [% IF CGI.param('detail_record_view') %]
+                        <a href="[% mkurl('', {detail_record_view => ''}) %]">[% l('Show Fewer Details') %]</a>
+                        [% ELSE %]
+                        <a href="[% mkurl('', {detail_record_view => 1}) %]">[% l('Show More Details') %]</a>
+                        [% END %]
+                    </div>
+                    <div class="results_header_div"></div>
+
+                    <label class="results_header_lbl">
+                        <input type="checkbox" id="limit_to_available" name="modifier" value="available"
+                            onchange="limit_to_avail_onchange(this, true)"
+                            [% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
+                        [% l('Limit to available items') %]
+                    </label>
+                <div class="clear-both"></div>
+            </div>
+        </div>
+    </div>
+    </form>
+    <br class="clear-both" />
+    <div id="content-wrapper">
+        <div id="main-content">
+            <div id="results-page">
+                [% path = "opac/parts/result/" _
+                    (ctx.records.size ? "table.tt2" : "lowhits.tt2");
+                INCLUDE $path %]
+            </div>
+            <div class="common-full-pad"></div>    
+        </div>
+        <br class="clear-both" />
+    </div>
+[% END %]
diff --git a/templates_tadlskin/opac/sms_cn.tt2 b/templates_tadlskin/opac/sms_cn.tt2
new file mode 100644 (file)
index 0000000..6a1dc16
--- /dev/null
@@ -0,0 +1,49 @@
+[%  PROCESS "opac/parts/header.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("Send Call Number via Text/SMS") %]
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" %]
+    </div>
+    <div id="content-wrapper">
+        <div id="main-content">
+            <div class="common-full-pad"></div>
+            <div>
+                <p>
+                    [% IF ctx.event != -1 %]
+                    <br/>
+                    [% IF ctx.sms_notify %]
+                    <h1>Your message has been sent!</h1>
+                    <a href="[% ctx.origin %]">Return to record</a>
+                    <pre>[% ctx.event.template_output.data %]</pre>
+                    [% ELSE %]
+                    <h1>Text call number</h1>
+                    <a href="[% ctx.origin %]">Return to record</a>
+                    <pre>[% ctx.event.template_output.data %]</pre>
+                    <blockquote>
+                        <form method="POST">
+                            <blockquote>
+                                <input type="hidden" name="copy_id" value="[% ctx.copy_id %]"/>
+                                <input type="hidden" name="origin" value="[% ctx.origin %]"/>
+                                [% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_warning="true" %]<br/>
+                                [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]<br/>
+                                <input type="submit"
+                                    name="submit"
+                                    value="[% l('Submit') %]"
+                                    title="[% l('Submit') %]"
+                                    alt="[% l('Submit') %]"
+                                    class="opac-button" />
+                                <br/>[% l('Note: carrier charges may apply'); %]
+                            </blockquote>
+                        </form>
+                    </blockquote>
+                    [% END %]
+                    [% ELSE %]
+                    <span>SMS not enabled for this site.</span>
+                    [% END %]
+                </p>
+            </div>
+            <div class="common-full-pad"></div>
+        </div>
+    </div>
+[% END %]