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 53-58 Link Here
53
                                    <th>Nonpublic notes</th>
53
                                    <th>Nonpublic notes</th>
54
                                    <th>Call number</th>
54
                                    <th>Call number</th>
55
                                    <th>Create item when receiving</th>
55
                                    <th>Create item when receiving</th>
56
                                    <th>Late issue notification</th>
56
                                    <th>Expiration date</th>
57
                                    <th>Expiration date</th>
57
                                </tr>
58
                                </tr>
58
                            </thead>
59
                            </thead>
Lines 75-80 Link Here
75
                                                <span>No</span>
76
                                                <span>No</span>
76
                                            [% END %]
77
                                            [% END %]
77
                                        </td>
78
                                        </td>
79
                                        <td>
80
                                            [% IF letters_map.defined(subscription.late_issue_letter_code) %]
81
                                                [% letters_map.item(subscription.late_issue_letter_code) | html %]
82
                                            [% ELSE %]
83
                                                [% subscription.late_issue_letter_code | html %]
84
                                            [% END %]
85
                                        </td>
78
                                        <td>[% subscription.enddate | $KohaDates %]</td>
86
                                        <td>[% subscription.enddate | $KohaDates %]</td>
79
                                    </tr>
87
                                    </tr>
80
                                [% END %]
88
                                [% END %]
Lines 145-150 Link Here
145
                                    </select>
153
                                    </select>
146
154
147
                                </li>
155
                                </li>
156
                                <li>
157
                                    <label for="late_issue_letter_code">Late issue notification: </label>
158
                                    <select id="late_issue_letter_code" name="late_issue_letter_code">
159
                                        <option value="">No change</option>
160
                                        [% FOREACH letter IN letters %]
161
                                            <option value="[% letter.code | html %]">[% letter.name | html %]</option>
162
                                        [% END %]
163
                                    </select>
164
                                </li>
148
                                <li>
165
                                <li>
149
                                    <label for="enddate">Expiration date: </label>
166
                                    <label for="enddate">Expiration date: </label>
150
                                    <input type="text" class="flatpickr" id="enddate" name="enddate" placeholder="No change"/>
167
                                    <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
    # If we convert a blank string we get todays date, we should only convert enddate if it is not blank
67
    # If we convert a blank string we get todays date, we should only convert enddate if it is not blank
66
    $params{'enddate'} = dt_from_string( scalar $cgi->param('enddate') ) if $cgi->param('enddate');
68
    $params{'enddate'} = dt_from_string( scalar $cgi->param('enddate') ) if $cgi->param('enddate');
Lines 97-107 if ( $op eq 'cud-batchedit' ) { Link Here
97
    exit;
99
    exit;
98
}
100
}
99
101
102
my $schema = Koha::Database->schema;
103
my @letters = $schema->resultset('Letter')->search(
104
    { module => 'serial' },
105
    {
106
        columns => ['code', 'name'],
107
        distinct => 1,
108
        order_by => 'code',
109
    },
110
);
111
my %letters_map = map { $_->code => $_->name } @letters;
112
100
$template->param(
113
$template->param(
101
    subscriptions               => \@subscriptions,
114
    subscriptions               => \@subscriptions,
102
    booksellers                 => [ Koha::Acquisition::Booksellers->search->as_list ],
115
    booksellers                 => [ Koha::Acquisition::Booksellers->search->as_list ],
103
    available_additional_fields => Koha::AdditionalFields->search( { tablename => 'subscription' } ),
116
    available_additional_fields => Koha::AdditionalFields->search( { tablename => 'subscription' } ),
104
    referrer                    => scalar $cgi->param('referrer'),
117
    referrer                    => scalar $cgi->param('referrer'),
118
    letters                     => \@letters,
119
    letters_map                 => \%letters_map,
105
);
120
);
106
121
107
output_html_with_http_headers $cgi, $cookie, $template->output;
122
output_html_with_http_headers $cgi, $cookie, $template->output;
108
- 

Return to bug 30096