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

(-)a/catalogue/detail.pl (-1 / +20 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 399-402 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
399
                                'sort'=>'-weight', limit=>$tag_quantity}));
399
                                'sort'=>'-weight', limit=>$tag_quantity}));
400
}
400
}
401
401
402
my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');
403
if ($StaffDetailItemSelection) {
404
    # Only enable item selection if user can execute at least one action
405
    if (
406
        $flags->{superlibrarian}
407
        || (
408
            ref $flags->{tools} eq 'HASH' && (
409
                $flags->{tools}->{items_batchmod}       # Modify selected items
410
                || $flags->{tools}->{items_batchdel}    # Delete selected items
411
            )
412
        )
413
        || ( ref $flags->{tools} eq '' && $flags->{tools} )
414
      )
415
    {
416
        $template->param(
417
            StaffDetailItemSelection => $StaffDetailItemSelection );
418
    }
419
}
420
402
output_html_with_http_headers $query, $cookie, $template->output;
421
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 406-408 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
406
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
406
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
407
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
407
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
408
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
408
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
409
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 (+11 lines)
Lines 6339-6344 if ( CheckVersion($DBversion) ) { Link Here
6339
   SetVersion ($DBversion);
6339
   SetVersion ($DBversion);
6340
}
6340
}
6341
6341
6342
$DBversion = "XXX";
6343
if (C4::Context->preference('Version') < TransformToNum($DBversion)) {
6344
    $dbh->do(qq{
6345
        INSERT INTO systempreferences (variable, value, explanation, options, type)
6346
        VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo')
6347
    });
6348
    print "Upgrade to $DBversion done (Add system preference StaffDetailItemSelection)\n";
6349
    SetVersion($DBversion);
6350
}
6351
6352
6342
=head1 FUNCTIONS
6353
=head1 FUNCTIONS
6343
6354
6344
=head2 TableExists($table)
6355
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-2 lines)
Lines 109-116 function confirm_items_deletion() { Link Here
109
	    var editmenu = [
109
	    var editmenu = [
110
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=&amp;op=" },[% END %]
110
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=&amp;op=" },[% END %]
111
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %]
111
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %]
112
            [% IF ( CAN_user_tools_items_batchmod ) %]{ text: _("Edit items in batch"), url: "/cgi-bin/koha/tools/batchMod.pl?op=show&biblionumber=[% biblionumber %]&src=CATALOGUING" },[% END %]
113
            [% IF ( CAN_user_tools_items_batchdel ) %]{ text: _("Delete items in batch"), url: "/cgi-bin/koha/tools/batchMod.pl?del=1&op=show&biblionumber=[% biblionumber %]&src=CATALOGUING" },[% END %]
114
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %]
112
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %]
115
            [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Link to host item"), url: "/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]" },[% END %][% END %]
113
            [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Link to host item"), url: "/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]" },[% END %][% END %]
116
            [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]{ text: _("Upload image"), url: "/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image" },[% END %][% END %]
114
            [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]{ text: _("Upload image"), url: "/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image" },[% 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 276-284 function verify_images() { Link Here
276
</ul>
312
</ul>
277
313
278
[% BLOCK items_table %]
314
[% BLOCK items_table %]
315
    [% IF (StaffDetailItemSelection) %]
316
        <a href="#" onclick="selectAllItems($(this).parent()); return false;">Select all</a> |
317
        <a href="#" onclick="deselectAllItems($(this).parent()); return false;">Deselect all</a> |
318
        <form onsubmit="itemSelectionExecuteAction($(this).parent()); return false;">
319
            <label>Action:</label>
320
            <select name="itemselection_action">
321
                [% IF CAN_user_tools_items_batchdel %]
322
                    <option value="delete">Delete selected items</option>
323
                [% END %]
324
                [% IF CAN_user_tools_items_batchmod %]
325
                    <option value="modify">Modify selected items</option>
326
                [% END %]
327
            </select>
328
            <input type="submit" value="Go" />
329
            <input type="checkbox" name="new_window" />
330
            <label>Open in new window</label>
331
        </form>
332
    [% END %]
279
    <table>
333
    <table>
280
        <thead>
334
        <thead>
281
            <tr>
335
            <tr>
336
                [% IF (StaffDetailItemSelection) %]<th></th>[% END %]
282
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
337
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
283
                <th>Current location</th>
338
                <th>Current location</th>
284
                <th>Home Library</th>
339
                <th>Home Library</th>
Lines 300-305 function verify_images() { Link Here
300
        <tbody>
355
        <tbody>
301
            [% FOREACH item IN items %]
356
            [% FOREACH item IN items %]
302
                <tr>
357
                <tr>
358
                [% IF (StaffDetailItemSelection) %]
359
                    <td style="text-align:center;vertical-align:middle">
360
                        <input type="checkbox" value="[% item.itemnumber %]" name="itemnumber" />
361
                    </td>
362
                [% END %]
303
                    [% IF ( item_level_itypes ) %]
363
                    [% IF ( item_level_itypes ) %]
304
                        <td class="itype">
364
                        <td class="itype">
305
                            [% IF !noItemTypeImages && item.imageurl %]
365
                            [% 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