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

(-)a/C4/Letters.pm (-1 / +8 lines)
Lines 737-742 sub _parseletter_sth { Link Here
737
    ($table eq 'accountlines' )    ? "SELECT * FROM $table WHERE   accountlines_id = ?"                               :
737
    ($table eq 'accountlines' )    ? "SELECT * FROM $table WHERE   accountlines_id = ?"                               :
738
    ($table eq 'biblio'       )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
738
    ($table eq 'biblio'       )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
739
    ($table eq 'biblioitems'  )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
739
    ($table eq 'biblioitems'  )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
740
    ($table eq 'catalog_concerns'  )    ? "SELECT * FROM $table WHERE   id = ?"                                       :
740
    ($table eq 'credits'      )    ? "SELECT * FROM accountlines WHERE   accountlines_id = ?"                         :
741
    ($table eq 'credits'      )    ? "SELECT * FROM accountlines WHERE   accountlines_id = ?"                         :
741
    ($table eq 'debits'       )    ? "SELECT * FROM accountlines WHERE   accountlines_id = ?"                         :
742
    ($table eq 'debits'       )    ? "SELECT * FROM accountlines WHERE   accountlines_id = ?"                         :
742
    ($table eq 'items'        )    ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
743
    ($table eq 'items'        )    ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
Lines 1608-1614 sub _process_tt { Link Here
1608
    my $tt_params = { %{ _get_tt_params( $tables ) }, %{ _get_tt_params( $loops, 'is_a_loop' ) }, %$substitute, %$objects };
1609
    my $tt_params = { %{ _get_tt_params( $tables ) }, %{ _get_tt_params( $loops, 'is_a_loop' ) }, %$substitute, %$objects };
1609
1610
1610
    $content = add_tt_filters( $content );
1611
    $content = add_tt_filters( $content );
1611
    $content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %]$content|;
1612
    $content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %][% PROCESS 'html_helpers.inc' %]$content|;
1612
1613
1613
    my $output;
1614
    my $output;
1614
    my $schema = Koha::Database->new->schema;
1615
    my $schema = Koha::Database->new->schema;
Lines 1644-1649 sub _get_tt_params { Link Here
1644
            plural   => 'biblios',
1645
            plural   => 'biblios',
1645
            pk       => 'biblionumber',
1646
            pk       => 'biblionumber',
1646
        },
1647
        },
1648
        catalog_concerns => {
1649
            module   => 'Koha::Catalog::Concerns',
1650
            singular => 'catalog_concern',
1651
            plural   => 'catalog_concerns',
1652
            pk       => 'id',
1653
        },
1647
        biblioitems => {
1654
        biblioitems => {
1648
            module   => 'Koha::Biblioitems',
1655
            module   => 'Koha::Biblioitems',
1649
            singular => 'biblioitem',
1656
            singular => 'biblioitem',
(-)a/Koha/Catalog/Concern.pm (-2 / +45 lines)
Lines 17-32 package Koha::Catalog::Concern; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
21
use base qw(Koha::Object);
20
use base qw(Koha::Object);
22
21
22
use C4::Letters;
23
23
=head1 NAME
24
=head1 NAME
24
25
25
Koha::Catalog::Concern - Koha Catalog::Concern Object class
26
Koha::Catalog::Concern - Koha Catalog::Concern Object class
26
27
27
=head1 API
28
=head1 API
28
29
29
=head2 Class methods
30
=head2 Relations
30
31
31
=cut
32
=cut
32
33
Lines 69-74 sub biblio { Link Here
69
    return Koha::Biblio->_new_from_dbic( $rs );
70
    return Koha::Biblio->_new_from_dbic( $rs );
70
}
71
}
71
72
73
=head2 Actions
74
72
=head3 resolve
75
=head3 resolve
73
76
74
  $concern = $concern->resolve(
77
  $concern = $concern->resolve(
Lines 105-110 sub resolve { Link Here
105
    return $self;
108
    return $self;
106
}
109
}
107
110
111
=head2 Core methods
112
113
=head3 store
114
115
Overloaded I<store> method to trigger notices as required
116
117
=cut
118
119
sub store {
120
    my ($self) = @_;
121
122
    my $is_new = !$self->in_storage;
123
    $self = $self->SUPER::store;
124
125
    if ($is_new && C4::Context->preference('CatalogerEmails') ) {
126
127
        # notify the library if a notice exists
128
        my $letter = C4::Letters::GetPreparedLetter(
129
            module      => 'catalog',
130
            letter_code => 'CONCERN_NOTIFY',
131
            branchcode  => $self->reporter->branchcode,
132
            tables      => { catalog_concerns => $self->id }
133
        );
134
135
        if ($letter) {
136
            my $message_id = C4::Letters::EnqueueLetter(
137
                {
138
                    letter                 => $letter,
139
                    message_transport_type => 'email',
140
                    to_address             => C4::Preference('CatalogerEmails'),
141
                    reply_address          => $self->reporter->notice_email_address,
142
                }
143
            );
144
            C4::Letters::SendQueuedMessages( { message_id => $message_id } );
145
        }
146
    }
147
148
    return $self;
149
}
150
108
=head2 Internal methods
151
=head2 Internal methods
109
152
110
=cut
153
=cut
(-)a/installer/data/mysql/atomicupdate/bug_31028.pl (+15 lines)
Lines 40-44 return { Link Here
40
	            ('OpacCatalogConcerns', '0', NULL, 'Allow logged in OPAC users to report catalog concerns', 'YesNo')
40
	            ('OpacCatalogConcerns', '0', NULL, 'Allow logged in OPAC users to report catalog concerns', 'YesNo')
41
	        }
41
	        }
42
        );
42
        );
43
44
        $dbh->do(
45
            q{
46
                INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
47
	            ('CatalogerEmails', '', '', 'Notify these catalogers by email when a catalog concern is submitted', 'free')
48
	        }
49
        );
50
51
        $dbh->do(
52
            q{
53
                INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
54
                VALUES ( 'catalog', 'CONCERN_NOTIFY', '', 'Catalog concern notification', '1', 'Catalog concern reported', "Dear cataloger,\r\n\r\n[% INCLUDE 'patron-title.inc' patron => catalog_concern.reporter %] reported the following concern with [% INCLUDE 'biblio-title.inc' biblio=catalog_concern.biblio link = 1 %]\r\n\r\n\r\n\r\n[% catalog_concern.message %]\r\n\r\n\r\n\r\nYou can mark this concern as resolved from the concern management <a href='[% Koha.Preference('IntranetBaseURL') %]/cgi-bin/koha/cataloguing/concerns.pl'>page</a>.", 'email' );
55
            }
56
        );
57
43
    },
58
    },
44
}
59
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (+16 lines)
Lines 43-48 tables: Link Here
43
            - ""
43
            - ""
44
            - "Your library."
44
            - "Your library."
45
45
46
        - module: catalog
47
          code: CONCERN_NOTIFY
48
          branchcode: ""
49
          name: "Concern notification"
50
          is_html: 1
51
          title: "Catalog concern reported"
52
          message_transport_type: email
53
          lang: default
54
          content:
55
            - "Dear cataloger,"
56
            - "[% INCLUDE 'patron-title.inc' patron => catalog_concern.reporter %] reported the following concern with [% INCLUDE 'biblio-title.inc' biblio=catalog_concern.biblio link = 1 %]"
57
            - ""
58
            - "[% catalog_concern.message %]"
59
            - ""
60
            - "You can mark this concern as resolved from the concern management <a href='[% Koha.Preference('IntranetBaseURL') %]/cgi-bin/koha/cataloguing/concerns.pl'>page</a>."
61
46
        - module: circulation
62
        - module: circulation
47
          code: ACCOUNT_CREDIT
63
          code: ACCOUNT_CREDIT
48
          branchcode: ""
64
          branchcode: ""
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 129-134 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
129
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
129
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
130
('casServerVersion','2', '2|3','Version of the CAS server Koha will connect to.','Choice'),
130
('casServerVersion','2', '2|3','Version of the CAS server Koha will connect to.','Choice'),
131
('CatalogConcerns', '0', NULL, 'Allow users to report catalog concerns', 'YesNo'),
131
('CatalogConcerns', '0', NULL, 'Allow users to report catalog concerns', 'YesNo'),
132
('CatalogerEmails', '', '', 'Notify these catalogers by email when a catalog concern is submitted', 'free'),
132
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
133
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
133
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
134
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
134
('ChargeFinesOnClosedDays','0',NULL,'Charge fines on days the library is closed.','YesNo'),
135
('ChargeFinesOnClosedDays','0',NULL,'Charge fines on days the library is closed.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-1 / +6 lines)
Lines 50-55 Cataloging: Link Here
50
                  1: Allow
50
                  1: Allow
51
            - "staff to report concerns about catalog records."
51
            - "staff to report concerns about catalog records."
52
            - '<strong>Note:</strong> You can also enable `OpacCatalogConcerns` to allow OPAC users the same option.'
52
            - '<strong>Note:</strong> You can also enable `OpacCatalogConcerns` to allow OPAC users the same option.'
53
        -
54
            - "Use "
55
            - pref: CatalogerEmails
56
              default: ''
57
              class: email
58
            - " as the notification address for catalog concerns."
53
59
54
    Spine labels:
60
    Spine labels:
55
        -
61
        -
56
- 

Return to bug 31028