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

(-)a/course_reserves/batch_add_items.pl (-11 / +4 lines)
Lines 20-26 Link Here
20
20
21
use Modern::Perl;
21
use Modern::Perl;
22
22
23
use CGI qw ( -utf8 );
23
use CGI qw( -utf8 );
24
use List::MoreUtils qw( uniq );
24
25
25
use C4::Auth;
26
use C4::Auth;
26
use C4::Output;
27
use C4::Output;
Lines 56-73 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
56
$template->param( course => GetCourse($course_id) );
57
$template->param( course => GetCourse($course_id) );
57
58
58
if ( !$action ) {
59
if ( !$action ) {
59
60
    $template->param( action => 'display_form' );
60
    my $itemtypes = Koha::ItemTypes->search;
61
    $template->param(
62
        action    => 'display_form',
63
        ccodes    => GetAuthorisedValues('CCODE'),
64
        locations => GetAuthorisedValues('LOC'),
65
        itypes    => $itemtypes,
66
    );
67
68
}
61
}
69
elsif ( $action eq 'add' ) {
62
elsif ( $action eq 'add' ) {
70
    my @barcodes = split( "\r\n", $barcodes );
63
    my @barcodes = uniq( split( /\s\n/, $barcodes ) );
71
64
72
    my @items;
65
    my @items;
73
    my @invalid_barcodes;
66
    my @invalid_barcodes;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt (-26 / +10 lines)
Lines 1-4 Link Here
1
[% USE AuthorisedValues %]
1
[% USE Branches %]
2
[% USE Branches %]
3
[% USE ItemTypes %]
4
2
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Course reserves &rsaquo; Add items</title>
6
<title>Koha &rsaquo; Course reserves &rsaquo; Add items</title>
4
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
Lines 32-43 Link Here
32
                            <select id="itype" name="itype">
35
                            <select id="itype" name="itype">
33
                                <option value="">LEAVE UNCHANGED</option>
36
                                <option value="">LEAVE UNCHANGED</option>
34
37
35
                                [% FOREACH it IN itypes %]
38
                                [% FOREACH it IN ItemTypes.Get() %]
36
                                    [% IF course_item.itype && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %]
39
                                    <option value="[% it.itemtype %]">[% it.description %]</option>
37
                                        <option value="[% it.itemtype %]" selected="selected">[% it.description %]</option>
38
                                    [% ELSE %]
39
                                        <option value="[% it.itemtype %]">[% it.description %]</option>
40
                                    [% END %]
41
                                [% END %]
40
                                [% END %]
42
                            </select>
41
                            </select>
43
                        </li>
42
                        </li>
Lines 47-59 Link Here
47
                            <label class="required" for="ccode">Collection code:</label>
46
                            <label class="required" for="ccode">Collection code:</label>
48
                            <select id="ccode" name="ccode">
47
                            <select id="ccode" name="ccode">
49
                                <option value="">LEAVE UNCHANGED</option>
48
                                <option value="">LEAVE UNCHANGED</option>
50
49
                                [% FOREACH c IN AuthorisedValues.Get('CCODE') %]
51
                                [% FOREACH c IN ccodes %]
50
                                    <option value="[% c.authorised_value %]">[% c.lib %]</option>
52
                                    [% IF course_item.ccode && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %]
53
                                        <option value="[% c.authorised_value %]" selected="selected">[% c.lib %]</option>
54
                                    [% ELSE %]
55
                                        <option value="[% c.authorised_value %]">[% c.lib %]</option>
56
                                    [% END %]
57
                                [% END %]
51
                                [% END %]
58
                            </select>
52
                            </select>
59
                        </li>
53
                        </li>
Lines 62-74 Link Here
62
                            <label class="required" for="location">Shelving location:</label>
56
                            <label class="required" for="location">Shelving location:</label>
63
                            <select id="location" name="location">
57
                            <select id="location" name="location">
64
                                <option value="">LEAVE UNCHANGED</option>
58
                                <option value="">LEAVE UNCHANGED</option>
65
59
                                [% FOREACH s IN AuthorisedValues.Get('LOC') %]
66
                                [% FOREACH s IN locations %]
60
                                    <option value="[% s.authorised_value %]">[% s.lib %]</option>
67
                                    [% IF course_item.location && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %]
68
                                        <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
69
                                    [% ELSE %]
70
                                        <option value="[% s.authorised_value %]">[% s.lib %]</option>
71
                                    [% END %]
72
                                [% END %]
61
                                [% END %]
73
                            </select>
62
                            </select>
74
                        </li>
63
                        </li>
Lines 78-88 Link Here
78
                            <select id="holdingbranch" name="holdingbranch">
67
                            <select id="holdingbranch" name="holdingbranch">
79
                                <option value="">LEAVE UNCHANGED</option>
68
                                <option value="">LEAVE UNCHANGED</option>
80
                                [% FOREACH b IN Branches.all() %]
69
                                [% FOREACH b IN Branches.all() %]
81
                                    [% IF course_item.holdingbranch && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %]
70
                                    <option value="[% b.branchcode %]">[% b.branchname %]</option>
82
                                        <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
83
                                    [% ELSE %]
84
                                        <option value="[% b.branchcode %]">[% b.branchname %]</option>
85
                                    [% END %]
86
                                [% END %]
71
                                [% END %]
87
                            </select>
72
                            </select>
88
                        </li>
73
                        </li>
89
- 

Return to bug 20467