56fbd6cee560e4caf9a7ae8f74c84cb99c74767d
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / anon_list.tt2
1         [% IF ctx.mylist.size %]
2         <div class="bookbag-specific">
3         <p class="big-strong">[% l('Basket') %]</p>
4         <div class="sort">
5             <form method="get">
6                 <label for="anonsort">[% l("Sort basket items by: ") %]</label>
7                 [% INCLUDE "opac/parts/filtersort.tt2" mode='bookbag'
8                     id="anonsort" name="anonsort" value=CGI.param("anonsort") %]
9                 <input type="hidden" name="id"
10                     value="[% CGI.param('id') | html %]" />
11                 [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
12                 <input class="opac-button" type="submit" value="[% l('Sort') %]" />
13             </form>
14         </div>
15         <form action="[% mkurl(ctx.opac_root _ '/mylist/move') %]" method="post">
16         <input type="hidden" name="orig_referrer" value="[% CGI.referer | html %]" />
17         <input type="hidden" name="redirect_to" value="[% mkurl('', {}, ['list_none_selected', 'cart_none_selected']) %]" />
18         <div class="bbag-action" style="clear:both;">
19             <select name="action">
20                 <option>[% l('-- Actions for these items --') %]</option>
21                 <option value="place_hold">[% l('Place hold') %]</option>
22                 <option value="print">[% l('Print title details') %]</option>
23                 <option value="email">[% l('Email title details') %]</option>
24                 <option value="delete">[% l('Remove from basket') %]</option>
25                 <option value="new_list">[% l('Add to new list') %]</option>
26                 [% IF ctx.user AND ctx.bookbags.size %]
27                     <optgroup label="[% l('Move selected items to list:') %]">
28                     [% FOR bbag IN ctx.bookbags %]]
29                         <option value="[% bbag.id %]" class="selector_actions_for_list_inner_option">[% bbag.name | html %]</option>
30                     [% END %]
31                     </optgroup>
32                 [% END %]
33             </select>
34             [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
35             <input class="opac-button" type="submit" value="[% l('Go') %]" />
36             <input type="checkbox" name="clear_cart">[% l('Clear entire basket when action complete') %]</input>
37             [% IF CGI.param('cart_none_selected') %]
38                 <span class="error">[% l('No items were selected') %]</span>
39             [% END %]
40         </div>
41         <div class="bbag-content">
42             <table class="bookbag-specific table_no_cell_pad table_no_border_space table_no_border">
43                 <thead id="acct_list_header_anon">
44                     <tr>
45                         <td class='list_checkbox'>
46                             <input type="checkbox" checked="checked" onclick="
47                                 var inputs=document.getElementsByTagName('input'); 
48                                 for (i = 0; i < inputs.length; i++) { 
49                                     if (inputs[i].name == 'record' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
50                         </td>
51                         <td><a href="[% mkurl('', {anonsort=>(CGI.param('anonsort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a></td>
52                         <td><a href="[% mkurl('', {anonsort=>(CGI.param('anonsort') == 'authorsort' ? 'authorsort.descending' : 'authorsort')}) %]">[% l('Author(s)') %]</a></td>
53                         <td>[% l('Local Call Number') %]</td>
54                     </tr>
55                 </thead>
56                 <tbody>
57                     [% FOR item IN ctx.mylist;
58                         attrs = {marc_xml => ctx.mylist_marc_xml.$item};
59                         PROCESS get_marc_attrs args=attrs %]
60                     <tr>
61                         <td class="list_checkbox">
62                             <input type="checkbox" checked="checked" name="record" value="[% item %]" />
63                         </td>
64                         <td class="list_entry" data-label="[% l('Title') %]"><a href="[% mkurl(ctx.opac_root _ '/record/' _ item, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a></td>
65                         <td class="list_entry" data-label="[% l('Author(s)') %]"><a href="[%-
66                             authorquery = attrs.author | replace('[,\.:;]', '');
67                             mkurl(
68                                 ctx.opac_root _ '/results',
69                                 {qtype => 'author', query => authorquery},
70                                 ['page', 'id', 'edit_notes']
71                             )
72                         -%]">[% attrs.author | html %]</a></td>
73                         <td class="list_entry" data-label="[% l('Local Call Number') %]">
74                         [% 
75                             copy = attrs.holdings.0;
76                             IF copy;
77                                 copy_org = ctx.get_aou_by_shortname(copy.owner);
78                                 FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc];
79                                     NEXT UNLESS ctx_org;
80                                     ctx_org = ctx.get_aou(ctx_org);
81                                     IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth);
82                                         l('[_1] ([_2])', copy.label, copy_org.name) | html;
83                                         LAST;
84                                     END;
85                                 END;
86                             END;
87                         %]
88                         </td>
89                     </tr>
90                     [% END %]
91                 </tbody>
92             </table>
93             <br /><br />
94         </div>
95         </form>
96         </div>
97         [% END %]