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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-batchedit.tt (+17 lines)
Lines 50-55 Link Here
50
                    <th>Nonpublic notes</th>
50
                    <th>Nonpublic notes</th>
51
                    <th>Call number</th>
51
                    <th>Call number</th>
52
                    <th>Create item when receiving</th>
52
                    <th>Create item when receiving</th>
53
                    <th>Late issue notification</th>
53
                    <th>Expiration date</th>
54
                    <th>Expiration date</th>
54
                </tr>
55
                </tr>
55
            </thead>
56
            </thead>
Lines 72-77 Link Here
72
                                <span>No</span>
73
                                <span>No</span>
73
                            [% END %]
74
                            [% END %]
74
                        </td>
75
                        </td>
76
                        <td>
77
                            [% IF letters_map.defined(subscription.late_issue_letter_code) %]
78
                                [% letters_map.item(subscription.late_issue_letter_code) | html %]
79
                            [% ELSE %]
80
                                [% subscription.late_issue_letter_code | html %]
81
                            [% END %]
82
                        </td>
75
                        <td>[% subscription.enddate | $KohaDates %]</td>
83
                        <td>[% subscription.enddate | $KohaDates %]</td>
76
                    </tr>
84
                    </tr>
77
                [% END %]
85
                [% END %]
Lines 141-146 Link Here
141
                        <option value="1">Yes</option>
149
                        <option value="1">Yes</option>
142
                    </select>
150
                    </select>
143
                </li>
151
                </li>
152
                <li>
153
                    <label for="late_issue_letter_code">Late issue notification: </label>
154
                    <select id="late_issue_letter_code" name="late_issue_letter_code">
155
                        <option value="">No change</option>
156
                        [% FOREACH letter IN letters %]
157
                            <option value="[% letter.code | html %]">[% letter.name | html %]</option>
158
                        [% END %]
159
                    </select>
160
                </li>
144
                <li>
161
                <li>
145
                    <label for="enddate">Expiration date: </label>
162
                    <label for="enddate">Expiration date: </label>
146
                    <input type="text" class="flatpickr" id="enddate" name="enddate" placeholder="No change" />
163
                    <input type="text" class="flatpickr" id="enddate" name="enddate" placeholder="No change" />
(-)a/serials/subscription-batchedit.pl (-8 / +22 lines)
Lines 27-32 use C4::Serials qw( can_edit_subscription ); Link Here
27
use Koha::Subscriptions;
27
use Koha::Subscriptions;
28
use Koha::Acquisition::Booksellers;
28
use Koha::Acquisition::Booksellers;
29
use Koha::AdditionalFields;
29
use Koha::AdditionalFields;
30
use Koha::Database;
30
use Koha::DateUtils qw( dt_from_string );
31
use Koha::DateUtils qw( dt_from_string );
31
32
32
my $cgi = CGI->new;
33
my $cgi = CGI->new;
Lines 54-66 my $available_additional_fields = Koha::AdditionalFields->search( { tablename => Link Here
54
my $op = $cgi->param('op') || q{};
55
my $op = $cgi->param('op') || q{};
55
if ( $op eq 'cud-batchedit' ) {
56
if ( $op eq 'cud-batchedit' ) {
56
    my %params = (
57
    my %params = (
57
        aqbooksellerid  => scalar $cgi->param('booksellerid'),
58
        aqbooksellerid         => scalar $cgi->param('booksellerid'),
58
        location        => scalar $cgi->param('location'),
59
        location               => scalar $cgi->param('location'),
59
        branchcode      => scalar $cgi->param('branchcode'),
60
        branchcode             => scalar $cgi->param('branchcode'),
60
        itemtype        => scalar $cgi->param('itemtype'),
61
        itemtype               => scalar $cgi->param('itemtype'),
61
        notes           => scalar $cgi->param('notes'),
62
        notes                  => scalar $cgi->param('notes'),
62
        internalnotes   => scalar $cgi->param('internalnotes'),
63
        internalnotes          => scalar $cgi->param('internalnotes'),
63
        serialsadditems => scalar $cgi->param('serialsadditems'),
64
        serialsadditems        => scalar $cgi->param('serialsadditems'),
65
        late_issue_letter_code => scalar $cgi->param('late_issue_letter_code'),
64
    );
66
    );
65
67
66
    # If we convert a blank string we get todays date, we should only convert enddate if it is not blank
68
    # If we convert a blank string we get todays date, we should only convert enddate if it is not blank
Lines 98-108 if ( $op eq 'cud-batchedit' ) { Link Here
98
    exit;
100
    exit;
99
}
101
}
100
102
103
my $schema = Koha::Database->schema;
104
my @letters = $schema->resultset('Letter')->search(
105
    { module => 'serial' },
106
    {
107
        columns => ['code', 'name'],
108
        distinct => 1,
109
        order_by => 'code',
110
    },
111
);
112
my %letters_map = map { $_->code => $_->name } @letters;
113
101
$template->param(
114
$template->param(
102
    subscriptions               => \@subscriptions,
115
    subscriptions               => \@subscriptions,
103
    booksellers                 => [ Koha::Acquisition::Booksellers->search->as_list ],
116
    booksellers                 => [ Koha::Acquisition::Booksellers->search->as_list ],
104
    available_additional_fields => Koha::AdditionalFields->search( { tablename => 'subscription' } ),
117
    available_additional_fields => Koha::AdditionalFields->search( { tablename => 'subscription' } ),
105
    referrer                    => scalar $cgi->param('referrer'),
118
    referrer                    => scalar $cgi->param('referrer'),
119
    letters                     => \@letters,
120
    letters_map                 => \%letters_map,
106
);
121
);
107
122
108
output_html_with_http_headers $cgi, $cookie, $template->output;
123
output_html_with_http_headers $cgi, $cookie, $template->output;
109
- 

Return to bug 30096