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

(-)a/Koha/Subscription.pm (-1 / +3 lines)
Lines 79-85 sub subscribers { Link Here
79
    my ($self) = @_;
79
    my ($self) = @_;
80
    my $schema = Koha::Database->new->schema;
80
    my $schema = Koha::Database->new->schema;
81
    my @borrowernumbers =
81
    my @borrowernumbers =
82
        $schema->resultset('Alert')->search( { externalid => $self->subscriptionid } )->get_column('borrowernumber')
82
        $schema->resultset('Alert')
83
        ->search( { externalid => $self->subscriptionid } )
84
        ->get_column('borrowernumber')
83
        ->all;
85
        ->all;
84
    return Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } } );
86
    return Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } } );
85
}
87
}
(-)a/installer/data/mysql/atomicupdate/Bug_17656-add-permanent-irregularities.perl (-3 / +5 lines)
Lines 10-20 return { Link Here
10
10
11
        if ( !column_exists( 'subscription', 'permanent_irregularity' ) ) {
11
        if ( !column_exists( 'subscription', 'permanent_irregularity' ) ) {
12
12
13
            $dbh->do(q{
13
            $dbh->do(
14
                q{
14
                ALTER TABLE `subscription`
15
                ALTER TABLE `subscription`
15
                ADD permanent_irregularity MEDIUMTEXT
16
                ADD permanent_irregularity MEDIUMTEXT COMMENT 'permanent irregularities for renewal'
16
                AFTER irregularity
17
                AFTER irregularity
17
            });
18
            }
19
            );
18
20
19
            say_success( $out, "Added column 'subscription.permanent_irregularity'" );
21
            say_success( $out, "Added column 'subscription.permanent_irregularity'" );
20
22
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 6491-6497 CREATE TABLE `subscription` ( Link Here
6491
  `firstacquidate` date DEFAULT NULL COMMENT 'first issue received date',
6491
  `firstacquidate` date DEFAULT NULL COMMENT 'first issue received date',
6492
  `manualhistory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes or no to managing the history manually',
6492
  `manualhistory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes or no to managing the history manually',
6493
  `irregularity` mediumtext DEFAULT NULL COMMENT 'any irregularities in the subscription',
6493
  `irregularity` mediumtext DEFAULT NULL COMMENT 'any irregularities in the subscription',
6494
  `permanent_irregularity` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'permanent irregularities for renewal',
6494
  `permanent_irregularity` mediumtext DEFAULT NULL COMMENT 'permanent irregularities for renewal',
6495
  `skip_serialseq` tinyint(1) NOT NULL DEFAULT 0,
6495
  `skip_serialseq` tinyint(1) NOT NULL DEFAULT 0,
6496
  `letter` varchar(20) DEFAULT NULL,
6496
  `letter` varchar(20) DEFAULT NULL,
6497
  `numberpattern` int(11) DEFAULT NULL COMMENT 'the numbering pattern used links to subscription_numberpatterns.id',
6497
  `numberpattern` int(11) DEFAULT NULL COMMENT 'the numbering pattern used links to subscription_numberpatterns.id',
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_weekly_choice.inc (-22 / +10 lines)
Lines 1-26 Link Here
1
<div class="row select-weeks">
1
<div class="row">
2
    <div class="col-lg-12">
2
    [% FOREACH p IN predictions_loop %]
3
        <div class="button-group">
3
        <div class="col-md-3">
4
            <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
4
            [% IF permanent_irreg.grep( p.dow ).0 == p.dow %]
5
                Week(s) not published
5
                <input type="checkbox" name="permanent_irregularity" id="week_[% p.dow | html %]" data-dow="[% p.dow | html %]" value="[% p.dow | html %]" class="skip" checked="checked" />
6
                <span class="caret"></span>
6
            [% ELSE %]
7
            </button>
7
                <input type="checkbox" name="permanent_irregularity" id="week_[% p.dow | html %]" data-dow="[% p.dow | html %]" value="[% p.dow | html %]" class="skip" />
8
            <ul class="dropdown-menu week-columns">
8
            [% END %]
9
                [% FOREACH p IN predictions_loop %]
9
            <label for="week_[% p.dow | html %]" class="inline">Week <b>#[% p.dow | html %]</b> ([% p.publicationdate | $KohaDates %])</label>
10
                    <li>
11
                        <a class="small" href="JavaScript:Void(0);">
12
                            [% IF permanent_irreg.grep( p.dow ).0 == p.dow %]
13
                                <input type="checkbox" name="permanent_irregularity" value="[% p.dow | html %]" data-dow="[% p.dow | html %]" class="skip" checked="checked" />
14
                            [% ELSE %]
15
                                <input type="checkbox" name="permanent_irregularity" value="[% p.dow | html %]" data-dow="[% p.dow | html %]" class="skip" />
16
                            [% END %]
17
                            &nbsp;Week <b>#[% p.dow | html %]</b> ([% p.publicationdate | $KohaDates %])
18
                        </a>
19
                    </li>
20
                [% END %]
21
            </ul>
22
        </div>
10
        </div>
23
    </div>
11
    [% END %]
24
</div>
12
</div>
25
<p>
13
<p>
26
    <em>Check weeks in the above list in order to keep them unpublished throughout upcoming renewals (permanent irregularities).</em>
14
    <em>Check weeks in the above list in order to keep them unpublished throughout upcoming renewals (permanent irregularities).</em>
(-)a/serials/showpredictionpattern.pl (-7 / +5 lines)
Lines 30-41 publication date, based on frequency and first publication date. Link Here
30
30
31
use Modern::Perl;
31
use Modern::Perl;
32
32
33
use CGI        qw ( -utf8 );
33
use CGI         qw ( -utf8 );
34
use Date::Calc qw( Add_Delta_Days Add_Delta_YM Day_of_Week Delta_Days );
34
use Date::Calc  qw( Add_Delta_Days Add_Delta_YM Day_of_Week Delta_Days );
35
use C4::Auth   qw( get_template_and_user );
35
use C4::Auth    qw( get_template_and_user );
36
use C4::Output qw( output_html_with_http_headers );
36
use C4::Output  qw( output_html_with_http_headers );
37
use C4::Serials
37
use C4::Serials qw( GetSubscription GetFictiveIssueNumber GetSeq GetSubscriptionIrregularities GetNextDate GetNextSeq );
38
    qw( GetSubscription GetFictiveIssueNumber GetSeq GetSubscriptionIrregularities GetNextDate GetNextSeq );
39
use C4::Serials::Frequency;
38
use C4::Serials::Frequency;
40
use Koha::DateUtils qw( dt_from_string );
39
use Koha::DateUtils qw( dt_from_string );
41
40
42
- 

Return to bug 17656