@@ -, +, @@ (staff client) - Delete selected items: redirect to batch items deletion - Modify selected items: redirect to batch items modification --- catalogue/detail.pl | 20 ++++++- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 10 ++++ .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 4 -- .../en/modules/admin/preferences/staff_client.pref | 6 ++ .../prog/en/modules/catalogue/detail.tt | 60 ++++++++++++++++++++ .../prog/en/modules/tools/batchMod-del.tt | 4 +- .../prog/en/modules/tools/batchMod-edit.tt | 4 +- 8 files changed, 100 insertions(+), 9 deletions(-) --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -49,7 +49,7 @@ my $query = CGI->new(); 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, @@ -410,5 +410,23 @@ if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref 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; --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -429,3 +429,4 @@ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) V INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo'); +INSERT INTO systempreferences (variable, value, explanation, options, type) VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -7058,6 +7058,16 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +if (C4::Context->preference('Version') < TransformToNum($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) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -145,10 +145,6 @@ CAN_user_serials_create_subscription ) %]
[% END %] [% IF ( item_level_itypes ) %] | Item type | [% END %]Current location | Home library | @@ -391,6 +446,11 @@ function verify_images() {
---|---|---|---|
+ + | + [% END %] [% IF ( item_level_itypes ) %]
[% IF !noItemTypeImages && item.imageurl %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt
@@ -180,8 +180,8 @@ for( x=0; x |