View | Details | Raw Unified | Return to bug 9044
Collapse All | Expand All

(-)a/catalogue/detail.pl (-1 / +19 lines)
Lines 48-54 my $query = CGI->new(); Link Here
48
48
49
my $analyze = $query->param('analyze');
49
my $analyze = $query->param('analyze');
50
50
51
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
51
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
52
    {
52
    {
53
    template_name   =>  'catalogue/detail.tmpl',
53
    template_name   =>  'catalogue/detail.tmpl',
54
        query           => $query,
54
        query           => $query,
Lines 405-409 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
405
405
406
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
406
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
407
$template->param( holdcount => $holdcount, holds => $holds );
407
$template->param( holdcount => $holdcount, holds => $holds );
408
my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');
409
if ($StaffDetailItemSelection) {
410
    # Only enable item selection if user can execute at least one action
411
    if (
412
        $flags->{superlibrarian}
413
        || (
414
            ref $flags->{tools} eq 'HASH' && (
415
                $flags->{tools}->{items_batchmod}       # Modify selected items
416
                || $flags->{tools}->{items_batchdel}    # Delete selected items
417
            )
418
        )
419
        || ( ref $flags->{tools} eq '' && $flags->{tools} )
420
      )
421
    {
422
        $template->param(
423
            StaffDetailItemSelection => $StaffDetailItemSelection );
424
    }
425
}
408
426
409
output_html_with_http_headers $query, $cookie, $template->output;
427
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 419-421 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
419
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo');
419
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo');
420
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short');
420
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short');
421
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
421
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
422
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 (+10 lines)
Lines 6655-6660 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6655
    SetVersion($DBversion);
6655
    SetVersion($DBversion);
6656
}
6656
}
6657
6657
6658
$DBversion = "3.11.00.XXX";
6659
if (C4::Context->preference('Version') < TransformToNum($DBversion)) {
6660
    $dbh->do(qq{
6661
        INSERT INTO systempreferences (variable, value, explanation, options, type)
6662
        VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo')
6663
    });
6664
    print "Upgrade to $DBversion done (Add system preference StaffDetailItemSelection)\n";
6665
    SetVersion($DBversion);
6666
}
6667
6658
=head1 FUNCTIONS
6668
=head1 FUNCTIONS
6659
6669
6660
=head2 TableExists($table)
6670
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-4 lines)
Lines 145-154 CAN_user_serials_create_subscription ) %] Link Here
145
            <li><a id="edititems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Edit items</a></li>
145
            <li><a id="edititems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Edit items</a></li>
146
            [% END %]
146
            [% END %]
147
147
148
            [% IF ( CAN_user_tools_items_batchmod ) %]<li><a href="/cgi-bin/koha/tools/batchMod.pl?op=show&amp;biblionumber=[% biblionumber %]&amp;src=CATALOGUING">Edit items in batch</a></li>[% END %]
149
150
            [% IF ( CAN_user_tools_items_batchdel ) %]<li><a href="/cgi-bin/koha/tools/batchMod.pl?del=1&amp;op=show&amp;biblionumber=[% biblionumber %]&amp;src=CATALOGUING">Delete items in a batch</a></li>[% END %]
151
152
            [% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]">Attach item</a></li>[% END %]
148
            [% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]">Attach item</a></li>[% END %]
153
149
154
            [% 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 %]
150
            [% 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 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref (+6 lines)
Lines 122-124 Staff Client: Link Here
122
                  yes: Show
122
                  yes: Show
123
                  no: "Don't show"
123
                  no: "Don't show"
124
            - the cart option in the staff client.
124
            - the cart option in the staff client.
125
        -
126
            - pref: StaffDetailItemSelection
127
              choices:
128
                  yes: Enable
129
                  no: Disable
130
            - item selection in record detail page.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+60 lines)
Lines 36-41 function verify_images() { Link Here
36
        }
36
        }
37
        });
37
        });
38
}
38
}
39
40
    [% IF StaffDetailItemSelection %]
41
        function selectAllItems(div) {
42
            $("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked');
43
        }
44
45
        function deselectAllItems(div) {
46
            $("input[name='itemnumber'][type='checkbox']", div).removeAttr('checked');
47
        }
48
49
        function itemSelectionExecuteAction(div) {
50
            var itemnumbers = new Array();
51
            $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
52
                itemnumbers.push($(this).val());
53
            });
54
            if (itemnumbers.length > 0) {
55
                var action = $('select[name="itemselection_action"]', div).val();
56
                var del = (action == 'delete') ? 1 : 0;
57
                var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
58
                if (action == 'delete') {
59
                    url += '&del=1';
60
                }
61
                url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
62
                url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
63
                new_window = $("input[name='new_window']", div).attr('checked');
64
                if (new_window) {
65
                    window.open(url);
66
                } else {
67
                    window.location.href = url;
68
                }
69
            } else {
70
                alert(_("Please select at least one item."));
71
            }
72
        }
73
    [% END %]
74
39
     $(document).ready(function() {
75
     $(document).ready(function() {
40
        $('#bibliodetails').tabs();
76
        $('#bibliodetails').tabs();
41
        $('#search-form').focus();
77
        $('#search-form').focus();
Lines 351-359 function verify_images() { Link Here
351
</ul>
387
</ul>
352
388
353
[% BLOCK items_table %]
389
[% BLOCK items_table %]
390
    [% IF (StaffDetailItemSelection) %]
391
        <a href="#" onclick="selectAllItems($(this).parent()); return false;">Select all</a> |
392
        <a href="#" onclick="deselectAllItems($(this).parent()); return false;">Deselect all</a> |
393
        <form onsubmit="itemSelectionExecuteAction($(this).parent()); return false;">
394
            <label>Action:</label>
395
            <select name="itemselection_action">
396
                [% IF CAN_user_tools_items_batchdel %]
397
                    <option value="delete">Delete selected items</option>
398
                [% END %]
399
                [% IF CAN_user_tools_items_batchmod %]
400
                    <option value="modify">Modify selected items</option>
401
                [% END %]
402
            </select>
403
            <input type="submit" value="Go" />
404
            <input type="checkbox" name="new_window" />
405
            <label>Open in new window</label>
406
        </form>
407
    [% END %]
354
    <table>
408
    <table>
355
        <thead>
409
        <thead>
356
            <tr>
410
            <tr>
411
                [% IF (StaffDetailItemSelection) %]<th></th>[% END %]
357
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
412
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
358
                <th>Current location</th>
413
                <th>Current location</th>
359
                <th>Home Library</th>
414
                <th>Home Library</th>
Lines 375-380 function verify_images() { Link Here
375
        <tbody>
430
        <tbody>
376
            [% FOREACH item IN items %]
431
            [% FOREACH item IN items %]
377
                <tr>
432
                <tr>
433
                [% IF (StaffDetailItemSelection) %]
434
                    <td style="text-align:center;vertical-align:middle">
435
                        <input type="checkbox" value="[% item.itemnumber %]" name="itemnumber" />
436
                    </td>
437
                [% END %]
378
                    [% IF ( item_level_itypes ) %]
438
                    [% IF ( item_level_itypes ) %]
379
                        <td class="itype">
439
                        <td class="itype">
380
                            [% IF !noItemTypeImages && item.imageurl %]
440
                            [% IF !noItemTypeImages && item.imageurl %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt (-2 / +2 lines)
Lines 178-185 for( x=0; x<allColumns.length; x++ ){ Link Here
178
	[% END %]
178
	[% END %]
179
179
180
    <p>
180
    <p>
181
        [% IF ( src == 'CATALOGUING') %]
181
        [% IF src %]
182
           <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Done</a>
182
           <a href="[% src %]">Done</a>
183
        [% ELSE %]
183
        [% ELSE %]
184
           <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
184
           <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
185
        [% END %]
185
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt (-3 / +2 lines)
Lines 190-197 $(document).ready(function(){ Link Here
190
[% END %]
190
[% END %]
191
[% ELSE %] <!-- // show -->
191
[% ELSE %] <!-- // show -->
192
<fieldset class="action">
192
<fieldset class="action">
193
[% IF ( src == 'CATALOGUING') %]
193
[% IF src %]
194
   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">Done</a>
194
   <a href="[% src %]">Done</a>
195
[% ELSE %]
195
[% ELSE %]
196
   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
196
   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
197
[% END %]
197
[% END %]
198
- 

Return to bug 9044