my $analyze = $query->param('analyze');
-my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
{
template_name => 'catalogue/detail.tmpl',
query => $query,
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
$template->param( holdcount => $holdcount, holds => $holds );
+my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');
+if ($StaffDetailItemSelection) {
+ # Only enable item selection if user can execute at least one action
+ if (
+ $flags->{superlibrarian}
+ || (
+ ref $flags->{tools} eq 'HASH' && (
+ $flags->{tools}->{items_batchmod} # Modify selected items
+ || $flags->{tools}->{items_batchdel} # Delete selected items
+ )
+ )
+ || ( ref $flags->{tools} eq '' && $flags->{tools} )
+ )
+ {
+ $template->param(
+ StaffDetailItemSelection => $StaffDetailItemSelection );
+ }
+}
output_html_with_http_headers $query, $cookie, $template->output;
('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'),
('StaffAuthorisedValueImages','1',NULL,'','YesNo'),
('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'),
+('StaffDetailItemSelection', '0', NULL, 'Enable item selection in record detail page', 'YesNo');
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the Staff client','Integer'),
('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'),
('SubfieldsToUseWhenPrefill','','','Define a list of subfields to use when prefilling items (separated by space)','Free'),
SetVersion($DBversion);
}
-
$DBversion = "3.13.00.022";
if ( CheckVersion($DBversion) ) {
$dbh->do("DELETE from auth_tag_structure WHERE tagfield IN ('68a','68b')");
SetVersion($DBversion);
}
+$DBversion = "XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(qq{
+ INSERT INTO systempreferences (variable, value, explanation, options, type)
+ VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo')
+ });
+ print "Upgrade to $DBversion done (Add system preference StaffDetailItemSelection)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
<li><a id="edititems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Edit items</a></li>
[% END %]
- [% IF ( CAN_user_tools_items_batchmod ) %]<li><a href="/cgi-bin/koha/tools/batchMod.pl?op=show&biblionumber=[% biblionumber %]&src=CATALOGUING">Edit items in batch</a></li>[% END %]
-
- [% IF ( CAN_user_tools_items_batchdel ) %]<li><a href="/cgi-bin/koha/tools/batchMod.pl?del=1&op=show&biblionumber=[% biblionumber %]&src=CATALOGUING">Delete items in a batch</a></li>[% END %]
-
[% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]">Attach item</a></li>[% END %]
[% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]">Link to host item</a>[% END %][% END %]
yes: Show
no: "Don't show"
- the cart option in the staff client.
+ -
+ - pref: StaffDetailItemSelection
+ choices:
+ yes: Enable
+ no: Disable
+ - item selection in record detail page.
}
- $(document).ready(function() {
+ [% IF StaffDetailItemSelection %]
+ function selectAllItems(div) {
+ $("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked');
+ }
+
+ function deselectAllItems(div) {
+ $("input[name='itemnumber'][type='checkbox']", div).removeAttr('checked');
+ }
+
+ function itemSelectionExecuteAction(div) {
+ var itemnumbers = new Array();
+ $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
+ itemnumbers.push($(this).val());
+ });
+ if (itemnumbers.length > 0) {
+ var action = $('select[name="itemselection_action"]', div).val();
+ var del = (action == 'delete') ? 1 : 0;
+ var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
+ if (action == 'delete') {
+ url += '&del=1';
+ }
+ url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
+ url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
+ new_window = $("input[name='new_window']", div).attr('checked');
+ if (new_window) {
+ window.open(url);
+ } else {
+ window.location.href = url;
+ }
+ } else {
+ alert(_("Please select at least one item."));
+ }
+ }
+ [% END %]
+
+ $(document).ready(function() {
$('#bibliodetails').tabs();
$('#search-form').focus();
$('.thumbnails > li > a > span.remove').click(function() {
</ul>
[% BLOCK items_table %]
+ [% IF (StaffDetailItemSelection) %]
+ <a href="#" onclick="selectAllItems($(this).parent()); return false;">Select all</a> |
+ <a href="#" onclick="deselectAllItems($(this).parent()); return false;">Deselect all</a> |
+ <form onsubmit="itemSelectionExecuteAction($(this).parent()); return false;">
+ <label>Action:</label>
+ <select name="itemselection_action">
+ [% IF CAN_user_tools_items_batchdel %]
+ <option value="delete">Delete selected items</option>
+ [% END %]
+ [% IF CAN_user_tools_items_batchmod %]
+ <option value="modify">Modify selected items</option>
+ [% END %]
+ </select>
+ <input type="submit" value="Go" />
+ <input type="checkbox" name="new_window" />
+ <label>Open in new window</label>
+ </form>
+ [% END %]
<table>
<thead>
<tr>
+ [% IF (StaffDetailItemSelection) %]<th></th>[% END %]
[% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
<th>Current location</th>
<th>Home library</th>
<tbody>
[% FOREACH item IN items %]
<tr>
+ [% IF (StaffDetailItemSelection) %]
+ <td style="text-align:center;vertical-align:middle">
+ <input type="checkbox" value="[% item.itemnumber %]" name="itemnumber" />
+ </td>
+ [% END %]
[% IF ( item_level_itypes ) %]
<td class="itype">
[% IF !noItemTypeImages && item.imageurl %]
[% END %]
<p>
- [% IF ( src == 'CATALOGUING') %]
- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Done</a>
+ [% IF src %]
+ <a href="[% src %]">Done</a>
[% ELSE %]
<a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
[% END %]
[% END %]
[% ELSE %] <!-- // show -->
<fieldset class="action">
-[% IF ( src == 'CATALOGUING') %]
- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">Done</a>
+[% IF src %]
+ <a href="[% src %]">Done</a>
[% ELSE %]
<a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
[% END %]