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

(-)a/C4/Serials.pm (-2 / +4 lines)
Lines 1291-1297 sub ModSubscription { Link Here
1291
    $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status,
1291
    $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status,
1292
    $biblionumber, $callnumber, $notes, $letter, $manualhistory,
1292
    $biblionumber, $callnumber, $notes, $letter, $manualhistory,
1293
    $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1293
    $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1294
    $graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq,
1294
    $graceperiod, $warn_when_late, $location, $enddate, $subscriptionid, $skip_serialseq,
1295
    $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template
1295
    $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template
1296
    ) = @_;
1296
    ) = @_;
1297
1297
Lines 1329-1334 sub ModSubscription { Link Here
1329
            staffdisplaycount => $staffdisplaycount,
1329
            staffdisplaycount => $staffdisplaycount,
1330
            opacdisplaycount  => $opacdisplaycount,
1330
            opacdisplaycount  => $opacdisplaycount,
1331
            graceperiod       => $graceperiod,
1331
            graceperiod       => $graceperiod,
1332
            warn_when_late    => $warn_when_late,
1332
            location          => $location,
1333
            location          => $location,
1333
            enddate           => $enddate,
1334
            enddate           => $enddate,
1334
            skip_serialseq    => $skip_serialseq,
1335
            skip_serialseq    => $skip_serialseq,
Lines 1373-1379 sub NewSubscription { Link Here
1373
    $lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3,
1374
    $lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3,
1374
    $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity,
1375
    $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity,
1375
    $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes,
1376
    $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes,
1376
    $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod,
1377
    $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $warn_when_late,
1377
    $location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode,
1378
    $location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode,
1378
    $published_on_template,
1379
    $published_on_template,
1379
    ) = @_;
1380
    ) = @_;
Lines 1412-1417 sub NewSubscription { Link Here
1412
            staffdisplaycount => $staffdisplaycount,
1413
            staffdisplaycount => $staffdisplaycount,
1413
            opacdisplaycount  => $opacdisplaycount,
1414
            opacdisplaycount  => $opacdisplaycount,
1414
            graceperiod       => $graceperiod,
1415
            graceperiod       => $graceperiod,
1416
            warn_when_late    => $warn_when_late,
1415
            location          => $location,
1417
            location          => $location,
1416
            enddate           => $enddate,
1418
            enddate           => $enddate,
1417
            skip_serialseq    => $skip_serialseq,
1419
            skip_serialseq    => $skip_serialseq,
(-)a/Koha/Serial.pm (+7 lines)
Lines 21-26 use Modern::Perl; Link Here
21
21
22
22
23
use Koha::Database;
23
use Koha::Database;
24
use Koha::Subscription;
24
25
25
use base qw(Koha::Object);
26
use base qw(Koha::Object);
26
27
Lines 34-39 Koha::Serial - Koha Serial Object class Link Here
34
35
35
=cut
36
=cut
36
37
38
sub subscription {
39
    my ($self) = @_;
40
41
    return Koha::Subscription->_new_from_dbic($self->_result->subscriptionid);
42
}
43
37
=head3 type
44
=head3 type
38
45
39
=cut
46
=cut
(-)a/installer/data/mysql/atomicupdate/bug-29996.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => '29996',
5
    description => 'Add subscription.warn_when_late',
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        unless (column_exists('subscription', 'warn_when_late')) {
11
            $dbh->do(q{
12
                ALTER TABLE subscription
13
                ADD COLUMN warn_when_late INT NOT NULL DEFAULT 0 COMMENT 'if enabled, late issues will be shown on main page' AFTER graceperiod
14
            });
15
        }
16
    },
17
};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 5528-5533 CREATE TABLE `subscription` ( Link Here
5528
  `staffdisplaycount` int(11) DEFAULT NULL COMMENT 'how many issues to show to the staff',
5528
  `staffdisplaycount` int(11) DEFAULT NULL COMMENT 'how many issues to show to the staff',
5529
  `opacdisplaycount` int(11) DEFAULT NULL COMMENT 'how many issues to show to the public',
5529
  `opacdisplaycount` int(11) DEFAULT NULL COMMENT 'how many issues to show to the public',
5530
  `graceperiod` int(11) NOT NULL DEFAULT 0 COMMENT 'grace period in days',
5530
  `graceperiod` int(11) NOT NULL DEFAULT 0 COMMENT 'grace period in days',
5531
  `warn_when_late` INT NOT NULL DEFAULT 0 COMMENT 'if enabled, late issues will be shown on main page',
5531
  `enddate` date DEFAULT NULL COMMENT 'subscription end date',
5532
  `enddate` date DEFAULT NULL COMMENT 'subscription end date',
5532
  `closed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes / no if the subscription is closed',
5533
  `closed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes / no if the subscription is closed',
5533
  `reneweddate` date DEFAULT NULL COMMENT 'date of last renewal for the subscription',
5534
  `reneweddate` date DEFAULT NULL COMMENT 'date of last renewal for the subscription',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-1 / +17 lines)
Lines 172-178 Link Here
172
                <div class="row">
172
                <div class="row">
173
                    <div class="col-sm-12">
173
                    <div class="col-sm-12">
174
                        [%# Following statement must be in one line for translatability %]
174
                        [%# Following statement must be in one line for translatability %]
175
                        [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count %]
175
                        [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count || late_subscriptions %]
176
                            <div id="area-pending" class="page-section">
176
                            <div id="area-pending" class="page-section">
177
                                [% IF pending_article_requests %]
177
                                [% IF pending_article_requests %]
178
                                <div class="pending-info" id="article_requests_pending">
178
                                <div class="pending-info" id="article_requests_pending">
Lines 261-266 Link Here
261
                                    </div>
261
                                    </div>
262
                                [% END %]
262
                                [% END %]
263
263
264
                                [% IF late_subscriptions %]
265
                                    <div class="pending-info" id="problem_late_subscriptions">
266
                                        <span>The following serials are late:</span>
267
                                        <ul>
268
                                        [% FOREACH s IN late_subscriptions %]
269
                                            <li>
270
                                                <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% s.subscription.subscriptionid | uri %]">[% s.subscription.biblio.title | html %]</a>:
271
                                                [% FOREACH serial IN s.serials %]
272
                                                    [% serial.serialseq | html %]
273
                                                    [% "," UNLESS loop.last %]
274
                                                [% END %]
275
                                            </li>
276
                                        [% END %]
277
                                        </ul>
278
                                    </div>
279
                                [% END %]
264
                            </div>
280
                            </div>
265
281
266
                        [% END %]
282
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (+9 lines)
Lines 237-242 fieldset.rows table { clear: none; margin: 0; } Link Here
237
                                    <label for="graceperiod">Grace period:</label>
237
                                    <label for="graceperiod">Grace period:</label>
238
                                    <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod | html %]" size="5"/> day(s)
238
                                    <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod | html %]" size="5"/> day(s)
239
                                </li>
239
                                </li>
240
                                <li>
241
                                    <label for="warn_when_late">Warn when late</label>
242
                                    [% IF warn_when_late %]
243
                                        <input type="checkbox" name="warn_when_late" id="warn_when_late" value="1" checked />
244
                                    [% ELSE %]
245
                                        <input type="checkbox" name="warn_when_late" id="warn_when_late" value="1" />
246
                                    [% END %]
247
                                    <div class="hint">Show an alert on main page when issues are late</div>
248
                                </li>
240
                                <li>
249
                                <li>
241
                                     <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
250
                                     <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
242
                                     <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount | html %]" inputmode="numeric" pattern="[0-9]*"  size="4"/>
251
                                     <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount | html %]" inputmode="numeric" pattern="[0-9]*"  size="4"/>
(-)a/mainpage.pl (-1 / +31 lines)
Lines 25-30 use C4::Output qw( output_html_with_http_headers ); Link Here
25
use C4::Auth qw( get_template_and_user );
25
use C4::Auth qw( get_template_and_user );
26
use C4::Koha;
26
use C4::Koha;
27
use C4::Tags qw( get_count_by_tag_status );
27
use C4::Tags qw( get_count_by_tag_status );
28
use C4::Serials;
28
use Koha::AdditionalContents;
29
use Koha::AdditionalContents;
29
use Koha::Patron::Modifications;
30
use Koha::Patron::Modifications;
30
use Koha::Patron::Discharge;
31
use Koha::Patron::Discharge;
Lines 33-38 use Koha::ArticleRequests; Link Here
33
use Koha::BiblioFrameworks;
34
use Koha::BiblioFrameworks;
34
use Koha::ProblemReports;
35
use Koha::ProblemReports;
35
use Koha::Quotes;
36
use Koha::Quotes;
37
use Koha::Serials;
36
use Koha::Suggestions;
38
use Koha::Suggestions;
37
use Koha::BackgroundJobs;
39
use Koha::BackgroundJobs;
38
use Koha::CurbsidePickups;
40
use Koha::CurbsidePickups;
Lines 135-147 if ( C4::Context->preference('CurbsidePickup') ) { Link Here
135
    );
137
    );
136
}
138
}
137
139
140
my @late_serials = Koha::Serials->search(
141
    {
142
        'me.status' => C4::Serials::LATE,
143
        'subscriptionid.warn_when_late' => 1,
144
        'subscriptionid.branchcode' => C4::Context->userenv->{branch},
145
    },
146
    {
147
        join => 'subscriptionid',
148
        prefetch => {
149
            subscriptionid => 'biblionumber',
150
        },
151
    }
152
)->as_list;
153
154
my %late_serials_grouped_by_subscription;
155
foreach my $serial (@late_serials) {
156
    my $subscriptionid = $serial->subscriptionid;
157
    $late_serials_grouped_by_subscription{$subscriptionid} //= {
158
        subscription => $serial->subscription,
159
        serials => [],
160
    };
161
    push @{ $late_serials_grouped_by_subscription{$subscriptionid}->{serials} }, $serial;
162
}
163
my @late_subscriptions = sort {
164
    $a->{subscription}->subscriptionid <=> $b->{subscription}->subscriptionid
165
} values %late_serials_grouped_by_subscription;
166
138
$template->param(
167
$template->param(
139
    pendingcomments                => $pendingcomments,
168
    pendingcomments                => $pendingcomments,
140
    pendingtags                    => $pendingtags,
169
    pendingtags                    => $pendingtags,
141
    pending_borrower_modifications => $pending_borrower_modifications,
170
    pending_borrower_modifications => $pending_borrower_modifications,
142
    pending_discharge_requests     => $pending_discharge_requests,
171
    pending_discharge_requests     => $pending_discharge_requests,
143
    pending_article_requests       => $pending_article_requests,
172
    pending_article_requests       => $pending_article_requests,
144
    pending_problem_reports        => $pending_problem_reports
173
    pending_problem_reports        => $pending_problem_reports,
174
    late_subscriptions             => \@late_subscriptions,
145
);
175
);
146
176
147
output_html_with_http_headers $query, $cookie, $template->output;
177
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/serials/subscription-add.pl (-3 / +4 lines)
Lines 303-308 sub redirect_add_subscription { Link Here
303
    my @irregularity   = $query->multi_param('irregularity');
303
    my @irregularity   = $query->multi_param('irregularity');
304
    my $locale         = $query->param('locale');
304
    my $locale         = $query->param('locale');
305
    my $graceperiod    = $query->param('graceperiod') || 0;
305
    my $graceperiod    = $query->param('graceperiod') || 0;
306
    my $warn_when_late = $query->param('warn_when_late');
306
307
307
    my $subtype = $query->param('subtype');
308
    my $subtype = $query->param('subtype');
308
    my $sublength = $query->param('sublength');
309
    my $sublength = $query->param('sublength');
Lines 356-362 sub redirect_add_subscription { Link Here
356
        $lastvalue3, $innerloop3, $status, $notes, $letter, $firstacquidate,
357
        $lastvalue3, $innerloop3, $status, $notes, $letter, $firstacquidate,
357
        join(";",@irregularity), $numberpattern, $locale, $callnumber,
358
        join(";",@irregularity), $numberpattern, $locale, $callnumber,
358
        $manualhistory, $internalnotes, $serialsadditems,
359
        $manualhistory, $internalnotes, $serialsadditems,
359
        $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate,
360
        $staffdisplaycount, $opacdisplaycount, $graceperiod, $warn_when_late, $location, $enddate,
360
        $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template
361
        $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template
361
    );
362
    );
362
    if ( (C4::Context->preference('Mana') == 1) and ( grep { $_ eq "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){
363
    if ( (C4::Context->preference('Mana') == 1) and ( grep { $_ eq "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){
Lines 434-439 sub redirect_mod_subscription { Link Here
434
	my $staffdisplaycount = $query->param('staffdisplaycount');
435
	my $staffdisplaycount = $query->param('staffdisplaycount');
435
	my $opacdisplaycount = $query->param('opacdisplaycount');
436
	my $opacdisplaycount = $query->param('opacdisplaycount');
436
    my $graceperiod     = $query->param('graceperiod') || 0;
437
    my $graceperiod     = $query->param('graceperiod') || 0;
438
    my $warn_when_late = $query->param('warn_when_late');
437
    my $location = $query->param('location');
439
    my $location = $query->param('location');
438
    my $itemtype          = $query->param('itemtype');
440
    my $itemtype          = $query->param('itemtype');
439
    my $previousitemtype  = $query->param('previousitemtype');
441
    my $previousitemtype  = $query->param('previousitemtype');
Lines 474-480 sub redirect_mod_subscription { Link Here
474
        $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, $innerloop3,
476
        $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, $innerloop3,
475
        $status, $biblionumber, $callnumber, $notes, $letter,
477
        $status, $biblionumber, $callnumber, $notes, $letter,
476
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
478
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
477
        $opacdisplaycount, $graceperiod, $location, $enddate, $subscriptionid,
479
        $opacdisplaycount, $graceperiod, $warn_when_late, $location, $enddate, $subscriptionid,
478
        $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template
480
        $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template
479
    );
481
    );
480
482
481
- 

Return to bug 29996