Koha/koha-tmpl/intranet-tmpl/prog/en/includes/clubs-table.inc
Owen Leonard ad85489139 Bug 29521: Fix style of patron clubs table when in clubs management
This patch follows up Bug 24627 to add some additional template logic to
the table of clubs so that the interface is consistent whether you're
looking at clubs during the holds process or during the clubs management
view.

The ways Bug 24627 made the clubs list more consistent with patron
search results made it LESS consistent with the Clubs management
interface.

To test, apply the patch and go to Tools -> Patron clubs.

- Scroll down to the "Clubs" table, below the "Club templates" table.
  - In the table of clubs, the club name should not be a link.
  - Hovering your mouse over the table should not highlight each row.

Confirm the previous behavior of a clubs search when placing a hold:

- Search the catalog and start the process of placing a hold on an item.
- On the "Place hold" page, click the "Clubs" tab and perform a search
  which will return multiple clubs.
- In this view, the club name should be a link. Clicking it should
  select that club for the hold.
- You should also be able to click anywhere in the row to select the
  club for the hold.

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-12-01 21:38:12 -10:00

116 lines
5.2 KiB
HTML

[% IF destination == 'holds' %]
<table id="clubs-table" class="selections-table">
[% ELSE %]
<table id="clubs-table">
[% END %]
<thead>
<tr>
<th>Name</th>
<th>Template</th>
<th>Description</th>
[% UNLESS destination == 'holds' %]
<th>Public enrollment</th>
<th>Email required</th>
[% END %]
<th>Library</th>
<th>Start date</th>
<th>End date</th>
<th>Enrolled patrons</th>
[% UNLESS destination == 'holds' %]
<th>&nbsp;</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH c IN clubs %]
[% IF destination == 'holds' %]
[% IF multi_hold %]
[% SET data_url = "/cgi-bin/koha/reserve/request.pl?club=" _ c.id _ "&amp;multi_hold=1&amp;biblionumbers=" _ biblionumbers %]
[% ELSE %]
[% SET data_url = "/cgi-bin/koha/reserve/request.pl?club=" _ c.id _ "&amp;biblionumber=" _ biblionumber %]
[% END %]
<tr class="clickable" data-url="[% data_url | html %]">
<td><a href="[% data_url | url %]">[% c.name | html %]</a></td>
[% ELSE %]
<tr>
<td>[% c.name | html %]</td>
[% END %]
<td>[% c.club_template.name | html %]</td>
<td>[% c.description | html %]</td>
[% UNLESS destination == 'holds' %]
<td>
[% IF c.club_template.is_enrollable_from_opac %]
Yes
[% ELSE %]
No
[% END %]
</td>
<td>
[% IF c.club_template.is_email_required %]
Yes
[% ELSE %]
No
[% END %]
</td>
[% END %]
<td>[% Branches.GetName( c.branchcode ) | html %]</td>
<td>
[% IF c.date_start %]
[% c.date_start | $KohaDates %]
[% END %]
</td>
<td>
[% IF c.date_end %]
[% c.date_end | $KohaDates %]
[% END %]
</td>
<td>
[% c.club_enrollments.count | html %]
</td>
[% UNLESS destination == 'holds' %]
<td class="actions">
<div class="btn-group dropup">
<a class="btn btn-default btn-xs dropdown-toggle" id="clubactions[% c.id | html %]" role="button" data-toggle="dropdown" href="#">
Actions <b class="caret"></b>
</a>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="clubactions[% c.id | html %]">
[% IF ( c.club_enrollments.count ) %]
<li>
<a href="club-enrollments.pl?id=[% c.id | uri %]">
<i class="fa fa-list-ul"></i> Enrollments
</a>
</li>
[% ELSE %]
<li class="disabled">
<a href="#" data-toggle="tooltip" data-placement="left" title="There are no enrollments for this club yet">
<i class="fa fa-list-ul"></i> Enrollments
</a>
</li>
[% END %]
[% IF CAN_user_clubs_edit_clubs %]
<li>
<a href="clubs-add-modify.pl?id=[% c.id | uri %]">
<i class="fa fa-pencil"></i> Edit
</a>
</li>
<li>
<a href="#" class="delete_club" data-id="[% c.id | html %]" data-name="[% c.name | html %]">
<i class="fa fa-trash"></i> Delete
</a>
</li>
[% END %]
[% IF ( c.club_enrollments.count ) %]
<li>
<a href="#" class="club_hold_search" data-id="[% c.id | html %]">
<i class="fa fa-search"></i> Search to hold
</a>
</li>
[% END %]
</ul>
</div>
</td>
[% END %]
</tr>
[% END %]
</tbody>
</table> <!-- /.clubs-table -->