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 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
        $flags->{superlibrarian}
385
        || (
386
            ref $flags->{tools} eq 'HASH' && (
387
                $flags->{tools}->{items_batchmod}       # Modify selected items
388
                || $flags->{tools}->{items_batchdel}    # Delete selected items
389
            )
390
        )
391
        || ( ref $flags->{tools} eq '' && $flags->{tools} )
392
      )
393
    {
394
        $template->param(
395
            StaffDetailItemSelection => $StaffDetailItemSelection );
396
    }
397
}
398
380
output_html_with_http_headers $query, $cookie, $template->output;
399
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 (+11 lines)
Lines 6055-6060 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6055
   SetVersion ($DBversion);
6055
   SetVersion ($DBversion);
6056
}
6056
}
6057
6057
6058
$DBversion = "XXX";
6059
if (C4::Context->preference('Version') < TransformToNum($DBversion)) {
6060
    $dbh->do(qq{
6061
        INSERT INTO systempreferences (variable, value, explanation, options, type)
6062
        VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo')
6063
    });
6064
    print "Upgrade to $DBversion done (Add system preference StaffDetailItemSelection)\n";
6065
    SetVersion($DBversion);
6066
}
6067
6068
6058
=head1 FUNCTIONS
6069
=head1 FUNCTIONS
6059
6070
6060
=head2 TableExists($table)
6071
=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 (+60 lines)
Lines 35-40 function verify_images() { Link Here
35
        }
35
        }
36
        });
36
        });
37
}
37
}
38
39
    [% IF StaffDetailItemSelection %]
40
        function selectAllItems(div) {
41
            $("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked');
42
        }
43
44
        function deselectAllItems(div) {
45
            $("input[name='itemnumber'][type='checkbox']", div).removeAttr('checked');
46
        }
47
48
        function itemSelectionExecuteAction(div) {
49
            var itemnumbers = new Array();
50
            $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
51
                itemnumbers.push($(this).val());
52
            });
53
            if (itemnumbers.length > 0) {
54
                var action = $('select[name="itemselection_action"]', div).val();
55
                var del = (action == 'delete') ? 1 : 0;
56
                var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
57
                if (action == 'delete') {
58
                    url += '&del=1';
59
                }
60
                url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
61
                url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
62
                new_window = $("input[name='new_window']", div).attr('checked');
63
                if (new_window) {
64
                    window.open(url);
65
                } else {
66
                    window.location.href = url;
67
                }
68
            } else {
69
                alert(_("Please select at least one item."));
70
            }
71
        }
72
    [% END %]
73
38
     $(document).ready(function() {
74
     $(document).ready(function() {
39
        $('#bibliodetails').tabs();
75
        $('#bibliodetails').tabs();
40
        $('#search-form').focus();
76
        $('#search-form').focus();
Lines 266-273 function verify_images() { Link Here
266
<div id="holdings">
302
<div id="holdings">
267
[% IF ( count ) %]
303
[% IF ( count ) %]
268
    [% IF ( showncount ) %]
304
    [% IF ( showncount ) %]
305
        [% IF (StaffDetailItemSelection) %]
306
            <a href="#" onclick="selectAllItems($(this).parent()); return false;">Select all</a> |
307
            <a href="#" onclick="deselectAllItems($(this).parent()); return false;">Deselect all</a> |
308
            <form onsubmit="itemSelectionExecuteAction($(this).parent()); return false;">
309
                <label>Action:</label>
310
                <select name="itemselection_action">
311
                    [% IF CAN_user_tools_items_batchdel %]
312
                        <option value="delete">Delete selected items</option>
313
                    [% END %]
314
                    [% IF CAN_user_tools_items_batchmod %]
315
                        <option value="modify">Modify selected items</option>
316
                    [% END %]
317
                </select>
318
                <input type="submit" value="Go" />
319
                <input type="checkbox" name="new_window" />
320
                <label>Open in new window</label>
321
            </form>
322
        [% END %]
269
        <table>
323
        <table>
270
            <tr>
324
            <tr>
325
                [% IF (StaffDetailItemSelection) %]<th></th>[% END %]
271
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
326
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
272
                <th>Current location</th>
327
                <th>Current location</th>
273
                <th>Home Library</th>
328
                <th>Home Library</th>
Lines 287-292 function verify_images() { Link Here
287
            </tr>
342
            </tr>
288
            [% FOREACH itemloo IN itemloop %]
343
            [% FOREACH itemloo IN itemloop %]
289
                <tr>
344
                <tr>
345
                [% IF (StaffDetailItemSelection) %]
346
                    <td style="text-align:center;vertical-align:middle">
347
                        <input type="checkbox" value="[% itemloo.itemnumber %]" name="itemnumber" />
348
                    </td>
349
                [% END %]
290
                    [% IF ( item_level_itypes ) %]
350
                    [% IF ( item_level_itypes ) %]
291
                    <td class="itype">
351
                    <td class="itype">
292
                        [% IF !noItemTypeImages && itemloo.imageurl %]
352
                        [% 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