($table eq 'accountlines' ) ? "SELECT * FROM $table WHERE accountlines_id = ?" :
($table eq 'biblio' ) ? "SELECT * FROM $table WHERE biblionumber = ?" :
($table eq 'biblioitems' ) ? "SELECT * FROM $table WHERE biblionumber = ?" :
+ ($table eq 'tickets' ) ? "SELECT * FROM $table WHERE id = ?" :
($table eq 'credits' ) ? "SELECT * FROM accountlines WHERE accountlines_id = ?" :
($table eq 'debits' ) ? "SELECT * FROM accountlines WHERE accountlines_id = ?" :
($table eq 'items' ) ? "SELECT * FROM $table WHERE itemnumber = ?" :
my $tt_params = { %{ _get_tt_params( $tables ) }, %{ _get_tt_params( $loops, 'is_a_loop' ) }, %$substitute, %$objects };
$content = add_tt_filters( $content );
- $content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %]$content|;
+ $content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %][% PROCESS 'html_helpers.inc' %]$content|;
my $output;
my $schema = Koha::Database->new->schema;
plural => 'suggestions',
pk => 'suggestionid',
},
+ tickets => {
+ module => 'Koha::Tickets',
+ singular => 'ticket',
+ plural => 'tickets',
+ pk => 'id',
+ },
issues => {
module => 'Koha::Checkouts',
singular => 'checkout',
use base qw(Koha::Object);
+use C4::Letters;
+
use Koha::Ticket::Update;
use Koha::Ticket::Updates;
return Koha::Ticket::Update->_new_from_dbic($rs);
}
+=head2 Core methods
+
+=head3 store
+
+Overloaded I<store> method to trigger notices as required
+
+=cut
+
+sub store {
+ my ($self) = @_;
+
+ my $is_new = !$self->in_storage;
+ $self = $self->SUPER::store;
+
+ if ($is_new) {
+
+ # Send patron acknowledgement
+ my $acknowledgement_letter = C4::Letters::GetPreparedLetter(
+ module => 'catalog',
+ letter_code => 'TICKET_ACKNOWLEDGEMENT',
+ branchcode => $self->reporter->branchcode,
+ tables => { tickets => $self->id }
+ );
+
+ if ($acknowledgement_letter) {
+ my $acknowledgement_message_id = C4::Letters::EnqueueLetter(
+ {
+ letter => $acknowledgement_letter,
+ message_transport_type => 'email',
+ borrowernumber => $self->reporter_id,
+ }
+ );
+ C4::Letters::SendQueuedMessages(
+ { message_id => $acknowledgement_message_id } );
+ }
+ }
+
+ return $self;
+}
+
=head2 Internal methods
=cut
);
say $out "`CatalogConcernTemplate` block added to html_customization";
}
+
+ $dbh->do(
+ q{
+ INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
+ VALUES ( 'catalog', 'TICKET_ACKNOWLEDGEMENT', '', 'Concern acknowledgement', '1', 'Catalog concern acknowledgement', "Dear [% INCLUDE 'patron-title.inc' patron => ticket.reporter %],\r\n\r\nThankyou for your report concerning [% INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 %].\r\n\r\nYou reported: \r\n[% ticket.body %]\r\n\r\nThankyou", 'email' );
+ }
+ );
+ say $out "Added new notice 'TICKET_ACKNOWLEDGEMENT'";
}
}
- ""
- "Your library."
+ - module: catalog
+ code: TICKET_ACKNOWLEDGEMENT
+ branchcode: ""
+ name: "Concern acknowledgement"
+ is_html: 1
+ title: "Catalog concern acknowledgment"
+ message_transport_type: email
+ lang: default
+ content:
+ - "Dear [% INCLUDE 'patron-title.inc' patron => ticket.reporter %],"
+ - ""
+ - "Thankyou for your report concerning [% INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 %]."
+ - ""
+ - "You reported: "
+ - "[% ticket.body %]"
+ - ""
+ - "Thankyou"
+
- module: circulation
code: ACCOUNT_CREDIT
branchcode: ""