it now works on the record detail page as well as the results page.
Also, I fixed a bug by which an HTML form was rendered wrongly, totally
breaking the display of the results page in IE and preventing the first
result on any page of search results from adding to the anonymous list.
sub fetch_marc_xml_by_id {
my ($self, $id_list) = @_;
$id_list = [$id_list] unless ref($id_list);
- return {} if scalar(grep { defined $_ } @$id_list) < 1;
+
+ {
+ no warnings qw/numeric/;
+ $id_list = [map { int $_ } @$id_list];
+ $id_list = [grep { $_ > 0} @$id_list];
+ };
+
+ return {} if scalar(@$id_list) < 1;
# I'm just sure there needs to be some more efficient way to get all of
# this.
left:2px;
}
+.almost-content-wrapper {
+ background: white;
+}
+
#content-wrapper {
background: white;
min-height: 260px;
<div style="width:230px;text-align:left;margin-top:3px;">
<div style="float:right;">
<div class="rdetail_aux_utils opac-auto-010">
- <a href="[% ctx.opac_root %]/place_hold[% propagator; propagator.length > 1 ? "&" : ""; %]hold_target=[% record.id %]&hold_type=T" id="rdetail_place_hold"><img
+ <a href="[% ctx.opac_root %]/place_hold[% propagator; propagator.length > 1 ? "&" : ""; %]hold_target=[% record.id %]&hold_type=T" id="rdetail_place_hold" class="no-dec"><img
src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" />
<span style="position:relative;top:-3px;left:3px;">Place Hold</span></a>
</div>
- <div style="padding-top:6px;" class="rdetail_aux_utils">
- <div style="position:absolute;">
- <div style="position:relative;top:5px; left: 25px;">
- <a title="Add to my list" id="add_mylist"
- href="#">Add to my list</a>
+ <div class="rdetail_aux_utils opac-auto-121">
+ [% operation = ctx.mylist.grep(record.id).size ? "delete" : "add";
+ label = (operation == "add") ? "Add to" : "Remove from"; %]
+ <form action="[% ctx.opac_root %]/mylist/[% operation %]" method="POST">
+ <input type="hidden" name="record" value="[% record.id %]" />
+ <div class="pos-abs">
+ <div class="opac-auto-149">
+ <input type="submit" title="[% l(label _ ' my list') %]" value="[% l(label _ ' my list') %]" class="subtle-button" />
+ </div>
</div>
- </div>
- <a href="#"><img
- alt="[% l('add to my list') %]"
- src="[% ctx.media_prefix %]/images/clipboard.png" /></a>
+ <input type="image"
+ alt="[% l(label _ ' my list') %]"
+ src="[% ctx.media_prefix %]/images/clipboard.png" />
+ </form>
</div>
</div>
<div style="float:right;margin-right:17px;">
style="position:relative;top:-3px;left:3px;">Place Hold</span></a>
</div>
<div class="results_aux_utils opac-auto-011">
- <form action="[% ctx.opac_root %]/mylist/add" method="POST">
+ [% operation = ctx.mylist.grep(rec.bre.id).size ? "delete" : "add";
+ label = (operation == "add") ? "Add to" : "Remove from"; %]
+ <form action="[% ctx.opac_root %]/mylist/[% operation %]" method="POST">
<input type="hidden" name="record" value="[% rec.bre.id %]" />
<div style="position:absolute;">
<div style="position:relative;top:5px; left: 25px;">
- <input type="submit" title="[% l('Add to my list') %]" value="[% l('Add to my list') %]" class="subtle-button" />
+ <input type="submit" title="[% l(label _ ' my list') %]" value="[% l(label _ ' my list') %]" class="subtle-button" />
</div>
</div>
<input type="image"
- alt="[% l('Add to my list') %]"
+ alt="[% l(label _ ' my list') %]"
src="[% ctx.media_prefix %]/images/clipboard.png" />
</form>
</div>
[% INCLUDE "default/opac/parts/utils.tt2" %]
[% INCLUDE "default/opac/parts/searchbar.tt2" took_care_of_form=1 %]
</div>
- <div id="content-wrapper">
+ <div class="almost-content-wrapper">
<div id="results_header_bar">
<div id="results_header_inner">
<div class="results_header_btns">
<div class="clear-both"></div>
</div>
</div>
+ </div>
+ </form>
+ <div id="content-wrapper">
<div id="main-content">
<div id="tehResultsPage">
[% path = "default/opac/parts/result/" _
<div class="common-full-pad"></div>
</div>
</div>
- </form>
[% END %]