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

(-)a/catalogue/detail.pl (-1 / +18 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 377-380 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
377
                                'sort'=>'-weight', limit=>$tag_quantity}));
377
                                'sort'=>'-weight', limit=>$tag_quantity}));
378
}
378
}
379
379
380
my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');
381
if ($StaffDetailItemSelection) {
382
    # Only enable item selection if user can execute at least one action
383
    if (
384
        (
385
            ref $flags->{tools} eq 'HASH' && (
386
                $flags->{tools}->{items_batchmod}       # Modify selected items
387
                || $flags->{tools}->{items_batchdel}    # Delete selected items
388
            )
389
        )
390
        || ( ref $flags->{tools} eq '' && $flags->{tools} )
391
      )
392
    {
393
        $template->param(StaffDetailItemSelection => $StaffDetailItemSelection);
394
    }
395
}
396
380
output_html_with_http_headers $query, $cookie, $template->output;
397
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 386-388 INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy Link Here
386
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
386
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
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 ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 6020-6025 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6020
   SetVersion ($DBversion);
6020
   SetVersion ($DBversion);
6021
}
6021
}
6022
6022
6023
$DBversion = "XXX";
6024
if (C4::Context->preference('Version') < TransformToNum($DBversion)) {
6025
    $dbh->do(qq{
6026
        INSERT INTO systempreferences (variable, value, explanation, options, type)
6027
        VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo')
6028
    });
6029
    print "Upgrade to $DBversion done (Add system preference StaffDetailItemSelection)\n";
6030
    SetVersion($DBversion);
6031
}
6032
6023
=head1 FUNCTIONS
6033
=head1 FUNCTIONS
6024
6034
6025
=head2 TableExists($table)
6035
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-2 lines)
Lines 110-117 function confirm_items_deletion() { Link Here
110
	    var editmenu = [
110
	    var editmenu = [
111
            [% 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_catalogue ) %]{ text: _("Edit record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=&amp;op=" },[% END %]
112
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %]
112
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %]
113
            [% 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 %]
114
            [% 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 %]
115
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %]
113
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %]
116
            [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Link to host item"), url: "/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]" },[% END %][% END %]
114
            [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Link to host item"), url: "/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]" },[% END %][% END %]
117
            [% 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 %]
115
            [% 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 (+49 lines)
Lines 35-40 function verify_images() { Link Here
35
        }
35
        }
36
        });
36
        });
37
}
37
}
38
39
    [% IF StaffDetailItemSelection %]
40
        function selectAllItems() {
41
            $("input[name='itemnumber'][type='checkbox']").attr('checked', 'checked');
42
        }
43
44
        function deselectAllItems() {
45
            $("input[name='itemnumber'][type='checkbox']").attr('checked', null);
46
        }
47
48
        function itemSelectionExecuteAction() {
49
            var itemnumbers = new Array();
50
            $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
51
                itemnumbers.push($(this).val());
52
            });
53
            var action = $('#itemselection_action').val();
54
            var del = (action == 'delete') ? 1 : 0;
55
            var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
56
            if (action == 'delete') {
57
                url += '&del=1';
58
            }
59
            url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
60
            url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
61
            window.location.href = url;
62
        }
63
    [% END %]
64
38
     $(document).ready(function() {
65
     $(document).ready(function() {
39
        $('#bibliodetails').tabs();
66
        $('#bibliodetails').tabs();
40
        $('#search-form').focus();
67
        $('#search-form').focus();
Lines 266-273 function verify_images() { Link Here
266
<div id="holdings">
293
<div id="holdings">
267
[% IF ( count ) %]
294
[% IF ( count ) %]
268
    [% IF ( showncount ) %]
295
    [% IF ( showncount ) %]
296
        [% IF (StaffDetailItemSelection) %]
297
            <a href="#" onclick="selectAllItems(); return false;">Select all</a> |
298
            <a href="#" onclick="deselectAllItems(); return false;">Deselect all</a> |
299
            <form onsubmit="itemSelectionExecuteAction(); return false;">
300
                <label for="itemselection_action">Action:</label>
301
                <select id="itemselection_action">
302
                    [% IF CAN_user_tools_items_batchdel %]
303
                        <option value="delete">Delete selected items</option>
304
                    [% END %]
305
                    [% IF CAN_user_tools_items_batchmod %]
306
                        <option value="modify">Modify selected items</option>
307
                    [% END %]
308
                </select>
309
                <input type="submit" value="Go" />
310
            </form>
311
        [% END %]
269
        <table>
312
        <table>
270
            <tr>
313
            <tr>
314
                [% IF (StaffDetailItemSelection) %]<th></th>[% END %]
271
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
315
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
272
                <th>Current location</th>
316
                <th>Current location</th>
273
                <th>Home Library</th>
317
                <th>Home Library</th>
Lines 287-292 function verify_images() { Link Here
287
            </tr>
331
            </tr>
288
            [% FOREACH itemloo IN itemloop %]
332
            [% FOREACH itemloo IN itemloop %]
289
                <tr>
333
                <tr>
334
                [% IF (StaffDetailItemSelection) %]
335
                    <td style="text-align:center;vertical-align:middle">
336
                        <input type="checkbox" value="[% itemloo.itemnumber %]" name="itemnumber" />
337
                    </td>
338
                [% END %]
290
                    [% IF ( item_level_itypes ) %]
339
                    [% IF ( item_level_itypes ) %]
291
                    <td class="itype">
340
                    <td class="itype">
292
                        [% IF !noItemTypeImages && itemloo.imageurl %]
341
                        [% 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 184-191 $(document).ready(function(){ Link Here
184
</div>
184
</div>
185
[% ELSE %] <!-- // show -->
185
[% ELSE %] <!-- // show -->
186
<fieldset class="action">
186
<fieldset class="action">
187
[% IF ( src == 'CATALOGUING') %]
187
[% IF src %]
188
   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">Done</a>
188
   <a href="[% src %]">Done</a>
189
[% ELSE %]
189
[% ELSE %]
190
   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
190
   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
191
[% END %]
191
[% END %]
192
- 

Return to bug 9044