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 410-414 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
410
410
411
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
411
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
412
$template->param( holdcount => $holdcount, holds => $holds );
412
$template->param( holdcount => $holdcount, holds => $holds );
413
my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');
414
if ($StaffDetailItemSelection) {
415
    # Only enable item selection if user can execute at least one action
416
    if (
417
        $flags->{superlibrarian}
418
        || (
419
            ref $flags->{tools} eq 'HASH' && (
420
                $flags->{tools}->{items_batchmod}       # Modify selected items
421
                || $flags->{tools}->{items_batchdel}    # Delete selected items
422
            )
423
        )
424
        || ( ref $flags->{tools} eq '' && $flags->{tools} )
425
      )
426
    {
427
        $template->param(
428
            StaffDetailItemSelection => $StaffDetailItemSelection );
429
    }
430
}
413
431
414
output_html_with_http_headers $query, $cookie, $template->output;
432
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 429-431 INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) V Link Here
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
430
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo');
430
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo');
431
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo');
431
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo');
432
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 7058-7063 if ( CheckVersion($DBversion) ) { Link Here
7058
    SetVersion($DBversion);
7058
    SetVersion($DBversion);
7059
}
7059
}
7060
7060
7061
$DBversion = "XXX";
7062
if (C4::Context->preference('Version') < TransformToNum($DBversion)) {
7063
    $dbh->do(qq{
7064
        INSERT INTO systempreferences (variable, value, explanation, options, type)
7065
        VALUES ('StaffDetailItemSelection', '0', 'Enable item selection in record detail page', NULL, 'YesNo')
7066
    });
7067
    print "Upgrade to $DBversion done (Add system preference StaffDetailItemSelection)\n";
7068
    SetVersion($DBversion);
7069
}
7070
7061
=head1 FUNCTIONS
7071
=head1 FUNCTIONS
7062
7072
7063
=head2 TableExists($table)
7073
=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 (+60 lines)
Lines 51-56 function verify_images() { Link Here
51
        }
51
        }
52
        });
52
        });
53
}
53
}
54
55
    [% IF StaffDetailItemSelection %]
56
        function selectAllItems(div) {
57
            $("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked');
58
        }
59
60
        function deselectAllItems(div) {
61
            $("input[name='itemnumber'][type='checkbox']", div).removeAttr('checked');
62
        }
63
64
        function itemSelectionExecuteAction(div) {
65
            var itemnumbers = new Array();
66
            $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
67
                itemnumbers.push($(this).val());
68
            });
69
            if (itemnumbers.length > 0) {
70
                var action = $('select[name="itemselection_action"]', div).val();
71
                var del = (action == 'delete') ? 1 : 0;
72
                var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
73
                if (action == 'delete') {
74
                    url += '&del=1';
75
                }
76
                url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
77
                url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
78
                new_window = $("input[name='new_window']", div).attr('checked');
79
                if (new_window) {
80
                    window.open(url);
81
                } else {
82
                    window.location.href = url;
83
                }
84
            } else {
85
                alert(_("Please select at least one item."));
86
            }
87
        }
88
    [% END %]
89
54
     $(document).ready(function() {
90
     $(document).ready(function() {
55
        $('#bibliodetails').tabs();
91
        $('#bibliodetails').tabs();
56
        $('#search-form').focus();
92
        $('#search-form').focus();
Lines 366-374 function verify_images() { Link Here
366
</ul>
402
</ul>
367
403
368
[% BLOCK items_table %]
404
[% BLOCK items_table %]
405
    [% IF (StaffDetailItemSelection) %]
406
        <a href="#" onclick="selectAllItems($(this).parent()); return false;">Select all</a> |
407
        <a href="#" onclick="deselectAllItems($(this).parent()); return false;">Deselect all</a> |
408
        <form onsubmit="itemSelectionExecuteAction($(this).parent()); return false;">
409
            <label>Action:</label>
410
            <select name="itemselection_action">
411
                [% IF CAN_user_tools_items_batchdel %]
412
                    <option value="delete">Delete selected items</option>
413
                [% END %]
414
                [% IF CAN_user_tools_items_batchmod %]
415
                    <option value="modify">Modify selected items</option>
416
                [% END %]
417
            </select>
418
            <input type="submit" value="Go" />
419
            <input type="checkbox" name="new_window" />
420
            <label>Open in new window</label>
421
        </form>
422
    [% END %]
369
    <table>
423
    <table>
370
        <thead>
424
        <thead>
371
            <tr>
425
            <tr>
426
                [% IF (StaffDetailItemSelection) %]<th></th>[% END %]
372
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
427
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
373
                <th>Current location</th>
428
                <th>Current location</th>
374
                <th>Home library</th>
429
                <th>Home library</th>
Lines 391-396 function verify_images() { Link Here
391
        <tbody>
446
        <tbody>
392
            [% FOREACH item IN items %]
447
            [% FOREACH item IN items %]
393
                <tr>
448
                <tr>
449
                [% IF (StaffDetailItemSelection) %]
450
                    <td style="text-align:center;vertical-align:middle">
451
                        <input type="checkbox" value="[% item.itemnumber %]" name="itemnumber" />
452
                    </td>
453
                [% END %]
394
                    [% IF ( item_level_itypes ) %]
454
                    [% IF ( item_level_itypes ) %]
395
                        <td class="itype">
455
                        <td class="itype">
396
                            [% IF !noItemTypeImages && item.imageurl %]
456
                            [% 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 191-198 $(document).ready(function(){ Link Here
191
[% END %]
191
[% END %]
192
[% ELSE %] <!-- // show -->
192
[% ELSE %] <!-- // show -->
193
<fieldset class="action">
193
<fieldset class="action">
194
[% IF ( src == 'CATALOGUING') %]
194
[% IF src %]
195
   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">Done</a>
195
   <a href="[% src %]">Done</a>
196
[% ELSE %]
196
[% ELSE %]
197
   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
197
   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
198
[% END %]
198
[% END %]
199
- 

Return to bug 9044