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

(-)a/catalogue/detail.pl (-1 / +20 lines)
Lines 47-53 my $query = CGI->new(); Link Here
47
47
48
my $analyze = $query->param('analyze');
48
my $analyze = $query->param('analyze');
49
49
50
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
50
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
51
    {
51
    {
52
    template_name   =>  'catalogue/detail.tmpl',
52
    template_name   =>  'catalogue/detail.tmpl',
53
        query           => $query,
53
        query           => $query,
Lines 379-382 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
379
                                'sort'=>'-weight', limit=>$tag_quantity}));
379
                                'sort'=>'-weight', limit=>$tag_quantity}));
380
}
380
}
381
381
382
my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');
383
if ($StaffDetailItemSelection) {
384
    # Only enable item selection if user can execute at least one action
385
    if (
386
        $flags->{superlibrarian}
387
        || (
388
            ref $flags->{tools} eq 'HASH' && (
389
                $flags->{tools}->{items_batchmod}       # Modify selected items
390
                || $flags->{tools}->{items_batchdel}    # Delete selected items
391
            )
392
        )
393
        || ( ref $flags->{tools} eq '' && $flags->{tools} )
394
      )
395
    {
396
        $template->param(
397
            StaffDetailItemSelection => $StaffDetailItemSelection );
398
    }
399
}
400
382
output_html_with_http_headers $query, $cookie, $template->output;
401
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 388-390 INSERT INTO systempreferences (variable, value, options, explanation, type) VALU Link Here
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
391
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 6134-6139 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6134
    SetVersion ($DBversion);
6134
    SetVersion ($DBversion);
6135
}
6135
}
6136
6136
6137
$DBversion = "3.11.00.XXX";
6138
if (C4::Context->preference('Version') < TransformToNum($DBversion)) {
6139
    $dbh->do(qq{
6140
        INSERT INTO systempreferences (variable, value, explanation, options, type)
6141
        VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo')
6142
    });
6143
    print "Upgrade to $DBversion done (Add system preference StaffDetailItemSelection)\n";
6144
    SetVersion($DBversion);
6145
}
6146
6137
=head1 FUNCTIONS
6147
=head1 FUNCTIONS
6138
6148
6139
=head2 TableExists($table)
6149
=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 272-279 function verify_images() { Link Here
272
<div id="holdings">
308
<div id="holdings">
273
[% IF ( count ) %]
309
[% IF ( count ) %]
274
    [% IF ( showncount ) %]
310
    [% IF ( showncount ) %]
311
        [% IF (StaffDetailItemSelection) %]
312
            <a href="#" onclick="selectAllItems($(this).parent()); return false;">Select all</a> |
313
            <a href="#" onclick="deselectAllItems($(this).parent()); return false;">Deselect all</a> |
314
            <form onsubmit="itemSelectionExecuteAction($(this).parent()); return false;">
315
                <label>Action:</label>
316
                <select name="itemselection_action">
317
                    [% IF CAN_user_tools_items_batchdel %]
318
                        <option value="delete">Delete selected items</option>
319
                    [% END %]
320
                    [% IF CAN_user_tools_items_batchmod %]
321
                        <option value="modify">Modify selected items</option>
322
                    [% END %]
323
                </select>
324
                <input type="submit" value="Go" />
325
                <input type="checkbox" name="new_window" />
326
                <label>Open in new window</label>
327
            </form>
328
        [% END %]
275
        <table>
329
        <table>
276
            <tr>
330
            <tr>
331
                [% IF (StaffDetailItemSelection) %]<th></th>[% END %]
277
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
332
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
278
                <th>Current location</th>
333
                <th>Current location</th>
279
                <th>Home Library</th>
334
                <th>Home Library</th>
Lines 293-298 function verify_images() { Link Here
293
            </tr>
348
            </tr>
294
            [% FOREACH itemloo IN itemloop %]
349
            [% FOREACH itemloo IN itemloop %]
295
                <tr>
350
                <tr>
351
                [% IF (StaffDetailItemSelection) %]
352
                    <td style="text-align:center;vertical-align:middle">
353
                        <input type="checkbox" value="[% itemloo.itemnumber %]" name="itemnumber" />
354
                    </td>
355
                [% END %]
296
                    [% IF ( item_level_itypes ) %]
356
                    [% IF ( item_level_itypes ) %]
297
                    <td class="itype">
357
                    <td class="itype">
298
                        [% IF !noItemTypeImages && itemloo.imageurl %]
358
                        [% IF !noItemTypeImages && itemloo.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