[% IF SuspendHoldsIntranet %]<th> </th><!-- Suspend Holds Column Header -->[% END %]
</tr>
+ [% SET first_priority = 0 %]
+ [% SET last_priority = holds.last.priority %]
+
[% FOREACH hold IN holds %]
+ [% IF !hold.found && first_priority == 0 %][% first_priority = hold.priority %][% END %]
<tr>
<td>
<input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" />
</td>
[% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
- [% SET first_priority = holds.first.priority %]
- [% SET last_priority = holds.last.priority %]
- [% SET prev_priority = loop.prev.priority %]
- [% SET next_priority = loop.next.priority %]
- [% holds.index | html %]
-
- <td style="white-space:nowrap;">
- <a title="Move hold up" href="request.pl?action=move&where=up&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
- <img src="[% interface | html %]/[% theme | html %]/img/go-up.png" alt="Go up" />
- </a>
-
- <a title="Move hold to top" href="request.pl?action=move&where=top&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
- <img src="[% interface | html %]/[% theme | html %]/img/go-top.png" alt="Go top" />
- </a>
-
- <a title="Move hold to bottom" href="request.pl?action=move&where=bottom&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
- <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Go bottom" />
- </a>
-
- <a title="Move hold down" href="request.pl?action=move&where=down&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
- <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Go down" />
- </a>
- </td>
+ [% UNLESS hold.found %]
+ [% SET prev_priority = loop.prev.priority %]
+ [% SET next_priority = loop.next.priority %]
+ [% holds.index | html %]
+
+ <td style="white-space:nowrap;">
+ <a title="Move hold up" href="request.pl?action=move&where=up&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
+ <img src="[% interface | html %]/[% theme | html %]/img/go-up.png" alt="Go up" />
+ </a>
+
+ <a title="Move hold to top" href="request.pl?action=move&where=top&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
+ <img src="[% interface | html %]/[% theme | html %]/img/go-top.png" alt="Go top" />
+ </a>
+
+ <a title="Move hold to bottom" href="request.pl?action=move&where=bottom&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
+ <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Go bottom" />
+ </a>
+
+ <a title="Move hold down" href="request.pl?action=move&where=down&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
+ <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Go down" />
+ </a>
+ </td>
+ [% ELSE %]
+ <td></td>
+ [% END %]
[% END %]
<td>
</td>
[% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
- <td>
- <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
- [% IF ( hold.lowestPriority ) %]
- <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" />
- [% ELSE %]
- <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" />
- [% END %]
- </a>
- </td>
+ [% UNLESS hold.found %]
+ <td>
+ <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
+ [% IF ( hold.lowestPriority ) %]
+ <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" />
+ [% ELSE %]
+ <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" />
+ [% END %]
+ </a>
+ </td>
+ [% ELSE %]
+ <td></td>
+ [% END %]
[% END %]
<td>