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

(-)a/catalogue/detail.pl (-1 / +19 lines)
Lines 49-55 my $query = CGI->new(); Link Here
49
49
50
my $analyze = $query->param('analyze');
50
my $analyze = $query->param('analyze');
51
51
52
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
52
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
53
    {
53
    {
54
    template_name   =>  'catalogue/detail.tmpl',
54
    template_name   =>  'catalogue/detail.tmpl',
55
        query           => $query,
55
        query           => $query,
Lines 411-415 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
411
411
412
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
412
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
413
$template->param( holdcount => $holdcount, holds => $holds );
413
$template->param( holdcount => $holdcount, holds => $holds );
414
my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');
415
if ($StaffDetailItemSelection) {
416
    # Only enable item selection if user can execute at least one action
417
    if (
418
        $flags->{superlibrarian}
419
        || (
420
            ref $flags->{tools} eq 'HASH' && (
421
                $flags->{tools}->{items_batchmod}       # Modify selected items
422
                || $flags->{tools}->{items_batchdel}    # Delete selected items
423
            )
424
        )
425
        || ( ref $flags->{tools} eq '' && $flags->{tools} )
426
      )
427
    {
428
        $template->param(
429
            StaffDetailItemSelection => $StaffDetailItemSelection );
430
    }
431
}
414
432
415
output_html_with_http_headers $query, $cookie, $template->output;
433
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 348-353 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
348
('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'),
348
('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'),
349
('StaffAuthorisedValueImages','1',NULL,'','YesNo'),
349
('StaffAuthorisedValueImages','1',NULL,'','YesNo'),
350
('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'),
350
('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'),
351
('StaffDetailItemSelection', '0', NULL, 'Enable item selection in record detail page', 'YesNo');
351
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the Staff client','Integer'),
352
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the Staff client','Integer'),
352
('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'),
353
('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'),
353
('SubfieldsToUseWhenPrefill','','','Define a list of subfields to use when prefilling items (separated by space)','Free'),
354
('SubfieldsToUseWhenPrefill','','','Define a list of subfields to use when prefilling items (separated by space)','Free'),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +10 lines)
Lines 7146-7152 if ( CheckVersion($DBversion) ) { Link Here
7146
    SetVersion($DBversion);
7146
    SetVersion($DBversion);
7147
}
7147
}
7148
7148
7149
7150
$DBversion = "3.13.00.022";
7149
$DBversion = "3.13.00.022";
7151
if ( CheckVersion($DBversion) ) {
7150
if ( CheckVersion($DBversion) ) {
7152
    $dbh->do("DELETE from auth_tag_structure WHERE tagfield IN ('68a','68b')");
7151
    $dbh->do("DELETE from auth_tag_structure WHERE tagfield IN ('68a','68b')");
Lines 7155-7160 if ( CheckVersion($DBversion) ) { Link Here
7155
    SetVersion($DBversion);
7154
    SetVersion($DBversion);
7156
}
7155
}
7157
7156
7157
$DBversion = "XXX";
7158
if ( CheckVersion($DBversion) ) {
7159
    $dbh->do(qq{
7160
        INSERT INTO systempreferences (variable, value, explanation, options, type)
7161
        VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo')
7162
    });
7163
    print "Upgrade to $DBversion done (Add system preference StaffDetailItemSelection)\n";
7164
    SetVersion($DBversion);
7165
}
7166
7158
=head1 FUNCTIONS
7167
=head1 FUNCTIONS
7159
7168
7160
=head2 TableExists($table)
7169
=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 128-130 Staff Client: Link Here
128
                  yes: Show
128
                  yes: Show
129
                  no: "Don't show"
129
                  no: "Don't show"
130
            - the cart option in the staff client.
130
            - the cart option in the staff client.
131
        -
132
            - pref: StaffDetailItemSelection
133
              choices:
134
                  yes: Enable
135
                  no: Disable
136
            - item selection in record detail page.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +60 lines)
Lines 70-76 function verify_images() { Link Here
70
70
71
    }
71
    }
72
72
73
    $(document).ready(function() {
73
    [% IF StaffDetailItemSelection %]
74
        function selectAllItems(div) {
75
            $("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked');
76
        }
77
78
        function deselectAllItems(div) {
79
            $("input[name='itemnumber'][type='checkbox']", div).removeAttr('checked');
80
        }
81
82
        function itemSelectionExecuteAction(div) {
83
            var itemnumbers = new Array();
84
            $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
85
                itemnumbers.push($(this).val());
86
            });
87
            if (itemnumbers.length > 0) {
88
                var action = $('select[name="itemselection_action"]', div).val();
89
                var del = (action == 'delete') ? 1 : 0;
90
                var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
91
                if (action == 'delete') {
92
                    url += '&del=1';
93
                }
94
                url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
95
                url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
96
                new_window = $("input[name='new_window']", div).attr('checked');
97
                if (new_window) {
98
                    window.open(url);
99
                } else {
100
                    window.location.href = url;
101
                }
102
            } else {
103
                alert(_("Please select at least one item."));
104
            }
105
        }
106
    [% END %]
107
108
     $(document).ready(function() {
74
        $('#bibliodetails').tabs();
109
        $('#bibliodetails').tabs();
75
        $('#search-form').focus();
110
        $('#search-form').focus();
76
        $('.thumbnails > li > a > span.remove').click(function() {
111
        $('.thumbnails > li > a > span.remove').click(function() {
Lines 402-410 function verify_images() { Link Here
402
</ul>
437
</ul>
403
438
404
[% BLOCK items_table %]
439
[% BLOCK items_table %]
440
    [% IF (StaffDetailItemSelection) %]
441
        <a href="#" onclick="selectAllItems($(this).parent()); return false;">Select all</a> |
442
        <a href="#" onclick="deselectAllItems($(this).parent()); return false;">Deselect all</a> |
443
        <form onsubmit="itemSelectionExecuteAction($(this).parent()); return false;">
444
            <label>Action:</label>
445
            <select name="itemselection_action">
446
                [% IF CAN_user_tools_items_batchdel %]
447
                    <option value="delete">Delete selected items</option>
448
                [% END %]
449
                [% IF CAN_user_tools_items_batchmod %]
450
                    <option value="modify">Modify selected items</option>
451
                [% END %]
452
            </select>
453
            <input type="submit" value="Go" />
454
            <input type="checkbox" name="new_window" />
455
            <label>Open in new window</label>
456
        </form>
457
    [% END %]
405
    <table>
458
    <table>
406
        <thead>
459
        <thead>
407
            <tr>
460
            <tr>
461
                [% IF (StaffDetailItemSelection) %]<th></th>[% END %]
408
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
462
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
409
                <th>Current location</th>
463
                <th>Current location</th>
410
                <th>Home library</th>
464
                <th>Home library</th>
Lines 427-432 function verify_images() { Link Here
427
        <tbody>
481
        <tbody>
428
            [% FOREACH item IN items %]
482
            [% FOREACH item IN items %]
429
                <tr>
483
                <tr>
484
                [% IF (StaffDetailItemSelection) %]
485
                    <td style="text-align:center;vertical-align:middle">
486
                        <input type="checkbox" value="[% item.itemnumber %]" name="itemnumber" />
487
                    </td>
488
                [% END %]
430
                    [% IF ( item_level_itypes ) %]
489
                    [% IF ( item_level_itypes ) %]
431
                        <td class="itype">
490
                        <td class="itype">
432
                            [% IF !noItemTypeImages && item.imageurl %]
491
                            [% IF !noItemTypeImages && item.imageurl %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt (-2 / +2 lines)
Lines 180-187 for( x=0; x<allColumns.length; x++ ){ Link Here
180
	[% END %]
180
	[% END %]
181
181
182
    <p>
182
    <p>
183
        [% IF ( src == 'CATALOGUING') %]
183
        [% IF src %]
184
           <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Done</a>
184
           <a href="[% src %]">Done</a>
185
        [% ELSE %]
185
        [% ELSE %]
186
           <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
186
           <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
187
        [% END %]
187
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt (-3 / +2 lines)
Lines 204-211 $(document).ready(function(){ Link Here
204
[% END %]
204
[% END %]
205
[% ELSE %] <!-- // show -->
205
[% ELSE %] <!-- // show -->
206
<fieldset class="action">
206
<fieldset class="action">
207
[% IF ( src == 'CATALOGUING') %]
207
[% IF src %]
208
   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">Done</a>
208
   <a href="[% src %]">Done</a>
209
[% ELSE %]
209
[% ELSE %]
210
   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
210
   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
211
[% END %]
211
[% END %]
212
- 

Return to bug 9044