From e3fdeb3405c2b41aa56f443abda0f936963b0bc9 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 25 Feb 2020 04:04:43 +0000 Subject: [PATCH] Bug 4461: (follow-up) Creating sample notice and other fixes - filters - capitalisation - atomic update --- C4/Letters.pm | 1 + Koha/ProblemReport.pm | 2 +- Koha/ProblemReports.pm | 2 +- .../bug-4461_add-problem-report-notice.perl | 7 +++++ .../bug-4461_add-problem-reports-table.perl | 33 +++++++++++----------- .../data/mysql/de-DE/mandatory/sample_notices.sql | 3 +- .../data/mysql/en/mandatory/sample_notices.sql | 3 +- .../data/mysql/es-ES/mandatory/sample_notices.sql | 3 +- .../mysql/fr-CA/obligatoire/sample_notices.sql | 3 +- .../mysql/fr-FR/1-Obligatoire/sample_notices.sql | 3 +- installer/data/mysql/it-IT/necessari/notices.sql | 3 +- .../mysql/nb-NO/1-Obligatorisk/sample_notices.sql | 3 +- .../data/mysql/pl-PL/mandatory/sample_notices.sql | 3 +- .../data/mysql/ru-RU/mandatory/sample_notices.sql | 3 +- .../data/mysql/uk-UA/mandatory/sample_notices.sql | 4 ++- .../bootstrap/en/modules/opac-reportproblem.tt | 10 +++---- opac/opac-reportproblem.pl | 19 ++++++++----- tools/letter.pl | 4 +++ 18 files changed, 69 insertions(+), 40 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug-4461_add-problem-report-notice.perl diff --git a/C4/Letters.pm b/C4/Letters.pm index 0233ef5..d82d125 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -758,6 +758,7 @@ sub _parseletter_sth { ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" : ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" : ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" : + ($table eq 'problem_reports') ? "SELECT * FROM $table WHERE reportid = ?" : undef ; unless ($query) { warn "ERROR: No _parseletter_sth query for table '$table'"; diff --git a/Koha/ProblemReport.pm b/Koha/ProblemReport.pm index 2ab6cb4..f93f7fa 100644 --- a/Koha/ProblemReport.pm +++ b/Koha/ProblemReport.pm @@ -2,7 +2,7 @@ package Koha::ProblemReport; # This file is part of Koha. # -# Copyright 2019 Aleisha Amohia +# Copyright 2020 Aleisha Amohia # # Koha is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software diff --git a/Koha/ProblemReports.pm b/Koha/ProblemReports.pm index ece7f55..a36fc3c 100644 --- a/Koha/ProblemReports.pm +++ b/Koha/ProblemReports.pm @@ -2,7 +2,7 @@ package Koha::ProblemReports; # This file is part of Koha. # -# Copyright 2019 Aleisha Amohia +# Copyright 2020 Aleisha Amohia # # Koha is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software diff --git a/installer/data/mysql/atomicupdate/bug-4461_add-problem-report-notice.perl b/installer/data/mysql/atomicupdate/bug-4461_add-problem-report-notice.perl new file mode 100644 index 0000000..bd642a5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-4461_add-problem-report-notice.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email') }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 4461 - Adding PROBLEM_REPORT notice)\n"; +} diff --git a/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl b/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl index 884c301..c837164 100644 --- a/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl +++ b/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl @@ -1,22 +1,23 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do(q{ DROP TABLE IF EXISTS `problem_reports` }); - $dbh->do(q{ CREATE TABLE problem_reports ( - reportid int(11) NOT NULL auto_increment, -- unqiue identifier assigned by Koha - title varchar(40) NOT NULL default '', -- report subject line - content varchar(255) NOT NULL default '', -- report message content - borrowernumber int(11) default NULL, -- the user who created the problem report - branchcode varchar(10) NOT NULL default '', -- borrower's branch - username varchar(75) default NULL, -- OPAC username - problempage varchar(255) default NULL, -- page the user triggered the problem report form from - recipient enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report - reportdate datetime default NULL, -- date and time of report submission - status varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed - PRIMARY KEY (reportid), - CONSTRAINT problem_reports_ibfk1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT problem_reports_ibfk2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci }); + if( !TableExists( 'problem_reports' ) ){ + $dbh->do(q{ CREATE TABLE problem_reports ( + reportid int(11) NOT NULL auto_increment, -- unqiue identifier assigned by Koha + title varchar(40) NOT NULL default '', -- report subject line + content varchar(255) NOT NULL default '', -- report message content + borrowernumber int(11) default NULL, -- the user who created the problem report + branchcode varchar(10) NOT NULL default '', -- borrower's branch + username varchar(75) default NULL, -- OPAC username + problempage varchar(255) default NULL, -- page the user triggered the problem report form from + recipient enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report + reportdate datetime default NULL, -- date and time of report submission + status varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed + PRIMARY KEY (reportid), + CONSTRAINT problem_reports_ibfk1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT problem_reports_ibfk2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci }); + } SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 4461: Add problem reports table)\n"; diff --git a/installer/data/mysql/de-DE/mandatory/sample_notices.sql b/installer/data/mysql/de-DE/mandatory/sample_notices.sql index 0fdef05..93dec2f 100644 --- a/installer/data/mysql/de-DE/mandatory/sample_notices.sql +++ b/installer/data/mysql/de-DE/mandatory/sample_notices.sql @@ -19,7 +19,8 @@ VALUES ('circulation','ODUE','Mahnung','Mahnung','Liebe/r < ('suggestions','AVAILABLE','Vorgeschlagenes Medium verfügbar', 'Das vorgeschlagene Medium ist jetzt verfügbar','Liebe(r) <> <>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <> von <>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Bestand der Bibliothek verfügbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <>.\n\nVielen Dank,\n\n<>', 'email'), ('suggestions','ORDERED','Vorgeschlagenes Medium bestellt', 'Das vorgeschlagene Medium wurde im Buchhandel bestellt','Liebe(r) <> <>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlaten: <> von <>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Buchhandel bestellt wurde. Nach Eintreffen wird er in unseren Bestand eingearbeitet.\n\nSie erhalten Nachricht, sobald das Medium verfügbar ist.\n\nBei Nachfragen erreichen Sie uns unter der Emailadresse <>.\n\nVielen Dank,\n\n<>', 'email'), ('suggestions','REJECTED','Anschaffungsvorschlag nicht angenommen', 'Ihr Anschaffungsvorschlag wurde nicht angenommen','Liebe(r) <> <>,\n\nSie haven der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <> von <>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und sich gegen eine Anschaffung entschieden.\n\nBegründung: <>\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <>.\n\nVielen Dank,\n\n<>', 'email'), -('suggestions','TO_PROCESS','Benachrichtigung an Besitzer des Kontos (Erwerbung)', 'Anschaffungsvorschlag wartet auf Bearbeitung','Liebe(r) <> <>,\n\nEin neuer Anschaffungsvorschlag wartet auf Bearbeitung: <> von <>.\n\nVielen Dank,\n\n<>', 'email'); +('suggestions','TO_PROCESS','Benachrichtigung an Besitzer des Kontos (Erwerbung)', 'Anschaffungsvorschlag wartet auf Bearbeitung','Liebe(r) <> <>,\n\nEin neuer Anschaffungsvorschlag wartet auf Bearbeitung: <> von <>.\n\nVielen Dank,\n\n<>', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','

Suggestion pendin g approval

diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql index 1fea003..d4e7450 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -19,7 +19,8 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <>.\n\nThank you,\n\n<>', 'email'), ('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <>\n\nThank you,\n\n<>', 'email'), ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <>\n\nIf you have any questions, please email us at <>.\n\nThank you,\n\n<>', 'email'), -('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <> <>,\n\nA new suggestion is ready to be processed: <> by <>.\n\nThank you,\n\n<>', 'email'); +('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <> <>,\n\nA new suggestion is ready to be processed: <> by <>.\n\nThank you,\n\n<>', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','

Suggestion pendin g approval

diff --git a/installer/data/mysql/es-ES/mandatory/sample_notices.sql b/installer/data/mysql/es-ES/mandatory/sample_notices.sql index 417cc64..695311d 100644 --- a/installer/data/mysql/es-ES/mandatory/sample_notices.sql +++ b/installer/data/mysql/es-ES/mandatory/sample_notices.sql @@ -19,7 +19,8 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <>\n\nThank you,\n\n<>', 'email'), ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <>\n\nIf you have any questions, please email us at <>.\n\nThank you,\n\n<>', 'email'), ('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <> <>,\n\nA new suggestion is ready to be processed: <> by <>.\n\nThank you,\n\n<>', 'email'), -('members', 'DISCHARGE', 'Discharge', 'Discharge for <> <>', '

Discharge

\r\n\r\nThe library <> certifies that the following borrower :\r\n\r\n <> <>\r\n Cardnumber : <>\r\n\r\nreturned all his documents.', 'email'); +('members', 'DISCHARGE', 'Discharge', 'Discharge for <> <>', '

Discharge

\r\n\r\nThe library <> certifies that the following borrower :\r\n\r\n <> <>\r\n Cardnumber : <>\r\n\r\nreturned all his documents.', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','

Suggestion pendin g approval

diff --git a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql index 0a8b2d2..99e92b6 100644 --- a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql @@ -66,7 +66,8 @@ INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, m ('acquisition','ACQ_NOTIF_ON_RECEIV','','Notification lors de la réception',0,'Commande reçue','Bonjour <> <bbbb>,\r\n\r\nLa commande <> (<>) a été reçue.\r\n\r\n<>','email'); INSERT INTO `letter` (module, code, name, title, content, message_transport_type) VALUES -('suggestions','TO_PROCESS','Notification pour le responsable du poste budgétaire', 'Une suggestion est prête à être traitée','Bonjour <> <>,\n\nUne nouvelle suggestion est prête à être traitée : <> par <>.\n\nMerci,\n\n<>', 'email'); +('suggestions','TO_PROCESS','Notification pour le responsable du poste budgétaire', 'Une suggestion est prête à être traitée','Bonjour <> <>,\n\nUne nouvelle suggestion est prête à être traitée : <> par <>.\n\nMerci,\n\n<>', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO letter ( module, code, branchcode, name, is_html, title, content, message_transport_type ) VALUES ('circulation', 'OVERDUES_SLIP', '', 'Ticket pour les documents en retard', '0', 'OVERDUES_SLIP', 'Le(s) document(s) est/sont présentement en retard : diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql index 3a80d51..e281423 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql @@ -21,7 +21,8 @@ VALUES ('suggestions','ORDERED','Suggestion commandée', 'Suggestion commandée','Cher(e) <> <>,\n\nVous avez effectué une demande de suggestion d\'achat sur le docuement <> de <>.\n\nNous sommes heureux de vous informer que le document que vous avez demandé est maintenant en commande. Le document devrait arriver rapidement dans nos collections.\n\nVous serez averti quand le docuement sera disponible.\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <>\n\nMerci,\n\n<>', 'email'), ('suggestions','REJECTED','Suggestion rejetée', 'Suggestion d\'achat rejeté','Cher(e) <> <>,\n\nVous avez fait la demande du document <> de <>.\n\nla Bibliothèque a examiné votre demande ce jour, et a décidé de ne pas retenir la suggestion pour l\'instant.\n\nLa raison est la suivante: <>\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <>.\n\nMerci,\n\n<>', 'email'), ('suggestions','TO_PROCESS','Avis au propriétaire du poste budgétaire', 'Une suggestion est prête à être traitée','<> <>,\n\nUne nouvelle suggestion est prête à être traitée : <> / <>.\n\nMerci,\n\n<>', 'email'), -('members', 'DISCHARGE', 'Quitus', 'Quitus pour <> <>', '

Quitus

\r\n\r\nLa librairie <> certifies que lecteur suivant :\r\n\r\n <> <>\r\n Numéro de carte : <>\r\n\r\na bien retourné tous ses documents.', 'email'); +('members', 'DISCHARGE', 'Quitus', 'Quitus pour <> <>', '

Quitus

\r\n\r\nLa librairie <> certifies que lecteur suivant :\r\n\r\n <> <>\r\n Numéro de carte : <>\r\n\r\na bien retourné tous ses documents.', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','

Suggestion pendin g approval

diff --git a/installer/data/mysql/it-IT/necessari/notices.sql b/installer/data/mysql/it-IT/necessari/notices.sql index 5a5f04c..61f9a3f 100644 --- a/installer/data/mysql/it-IT/necessari/notices.sql +++ b/installer/data/mysql/it-IT/necessari/notices.sql @@ -26,7 +26,8 @@ biblio.title>>\r\n----\r\nGrazie per aver visitaro <>.', 'e ('suggestions','ORDERED','Suggerimento d\'acquisto ordinato', 'Suggerimento d\'acquisto ordinato','Salve <> <>,\n\nHai suggerito di acquistare <> di <>.\n\nTi informiamo che l\'ordine è stata inviato al fornitore della biblioteca. Dovrebbe arrivare in poco tempo, poi verrà aggiunto alla collezione della biblioteca.\n\nRiceverai un\'altra email quando sarà disponibile.\n\nSe hai domande, scrivici pure all\' email <>\n\nGrazie di tutto,\n\n<>', 'email'), ('suggestions','REJECTED','Suggerimento d\'acquisto rifiutato', 'Suggerimento d\'acquisto rifiutato','Salve <> <>,\n\nHai suggerito di acquistare <> di <>.\n\na biblioteca ha revisionato il suggerimento oggi e ha deciso di non seguire il suggerimento.\n\nLa motivazione è: <>\n\nSe hai domande, scrivici pure all\' email <>.\n\nGrazie di tuttp,\n\n<>', 'email'), ('suggestions','TO_PROCESS','Notifica al proprietario del fondo', 'Un suggeerimento è pronto per essere lavorato','Caro bibliotecario <> <>,\n\n c\'è un nuovo suggerimento pronto per essere lavorato: <> by <>.\n\n Grazie dell\'attenzione,\n\n<>', 'email'), -('members', 'DISCHARGE', 'Liberatoria', 'Liberatoria per <> <>', '

Liberatoria

\r\n\r\nLa biblioteca <> certifica che il seguente utente :\r\n\r\n <> <>\r\n Numero tessera : <>\r\n\r\nha restituito tutti i documenti ricevuti.', 'email'); +('members', 'DISCHARGE', 'Liberatoria', 'Liberatoria per <> <>', '

Liberatoria

\r\n\r\nLa biblioteca <> certifica che il seguente utente :\r\n\r\n <> <>\r\n Numero tessera : <>\r\n\r\nha restituito tutti i documenti ricevuti.', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','

Suggestion pendin g approval

diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql index 921af85..2f8d928 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql @@ -42,7 +42,8 @@ VALUES ('circulation','ODUE','Purring','Purring på dokument','<> <>,\n\nDu har foreslått at biblioteket kjøper inn <> av <>.\n\nVi har gleden av å informere deg om at dokumentet du foreslo nå er i bestilling.\n\nDu vil få en ny melding når dokumentet er tilgjengelig.\n\nEr det noe du lurer på, vennligst kontakt oss på <>.\n\nVennlig hilsen,\n\n<>', 'email'), ('suggestions','REJECTED','Innkjøpsforslag avslått', 'Innkjøpsforslag avslått','<> <>,\n\nDu har foreslått at biblioteket kjøper inn <> av <>.\n\nBiblioteket har vurdert innkjøpsforslaget ditt i dag, og bestemt seg for å ikke ta det til følge.\n\nBegrunnelse: <>\n\nEr det noe du lurer på, vennligst kontakt oss på <>.\n\nVennlig hilsen,\n\n<>', 'email'), ('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <> <>,\n\nA new suggestion is ready to be processed: <> by <>.\n\nThank you,\n\n<>', 'email'), -('members', 'DISCHARGE', 'Discharge', 'Discharge for <> <>', '

Discharge

\r\n\r\nThe library <> certifies that the following borrower :\r\n\r\n <> <>\r\n Cardnumber : <>\r\n\r\nreturned all his documents.', 'email'); +('members', 'DISCHARGE', 'Discharge', 'Discharge for <> <>', '

Discharge

\r\n\r\nThe library <> certifies that the following borrower :\r\n\r\n <> <>\r\n Cardnumber : <>\r\n\r\nreturned all his documents.', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','

Suggestion pendin g approval

diff --git a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql index e031600..78cb5ef 100644 --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql @@ -20,7 +20,8 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <>\n\nThank you,\n\n<>', 'email'), ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <>\n\nIf you have any questions, please email us at <>.\n\nThank you,\n\n<>', 'email'), ('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <> <>,\n\nA new suggestion is ready to be processed: <> by <>.\n\nThank you,\n\n<>', 'email'), -('members', 'DISCHARGE', 'Discharge', 'Discharge for <> <>', '

Discharge

\r\n\r\nThe library <> certifies that the following borrower :\r\n\r\n <> <>\r\n Cardnumber : <>\r\n\r\nreturned all his documents.', 'email'); +('members', 'DISCHARGE', 'Discharge', 'Discharge for <> <>', '

Discharge

\r\n\r\nThe library <> certifies that the following borrower :\r\n\r\n <> <>\r\n Cardnumber : <>\r\n\r\nreturned all his documents.', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','

Suggestion pendin g approval

diff --git a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql index 677ec82..2e83625 100644 --- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql +++ b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql @@ -19,7 +19,8 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <>\n\nThank you,\n\n<>', 'email'), ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <>\n\nIf you have any questions, please email us at <>.\n\nThank you,\n\n<>', 'email'), ('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <> <>,\n\nA new suggestion is ready to be processed: <> by <>.\n\nThank you,\n\n<>', 'email'), -('members', 'DISCHARGE', 'Discharge', 'Discharge for <> <>', '

Discharge

\r\n\r\nThe library <> certifies that the following borrower :\r\n\r\n <> <>\r\n Cardnumber : <>\r\n\r\nreturned all his documents.', 'email'); +('members', 'DISCHARGE', 'Discharge', 'Discharge for <> <>', '

Discharge

\r\n\r\nThe library <> certifies that the following borrower :\r\n\r\n <> <>\r\n Cardnumber : <>\r\n\r\nreturned all his documents.', 'email'), +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email'); INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','

Suggestion pendin g approval

diff --git a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql index b270eb0..0992141 100644 --- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql +++ b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql @@ -81,7 +81,9 @@ INSERT INTO `letter` (module, code, name, title, content, message_transport_type ('suggestions','TO_PROCESS','Увідомлення фондотримача', 'Пропозиція готова то обробки', 'Дорог(ий/а) <> <>,\n\n нова пропозиція гоотова до обробки: „<>“ / <>.\n\n Спасибі,\n\n<>', - 'email') + 'email'), + +('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <>\n\nProblem page: <>\n\nTitle: <>\n\nMessage: <>','email') ; INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt index 102f63c..965fefd 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt @@ -1,6 +1,6 @@ [% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] -[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Report a Problem +[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › Report a problem [% INCLUDE 'doc-head-close.inc' %] [% BLOCK cssinclude %][% END %] @@ -28,7 +28,7 @@

Report a problem

[% IF ( successfuladd ) %] -
Your problem report has been sent to the [% IF ( recipient == 'admin' ) %]Koha Administrator[% ELSE %][% recipient %][% END %].
+
Your problem report has been sent to the [% IF ( recipient == 'admin' ) %]Koha Administrator[% ELSE %][% recipient | html %][% END %].
[% END %] [% IF ( ( nolibemail and noadminemail ) or norecipients ) %]
Unable to send problem reports.
@@ -53,16 +53,16 @@
  • - + [% probpage | html %]
  • - + [% username | html %]
  • - +
  • diff --git a/opac/opac-reportproblem.pl b/opac/opac-reportproblem.pl index 7660e6c..7cc261d 100644 --- a/opac/opac-reportproblem.pl +++ b/opac/opac-reportproblem.pl @@ -89,17 +89,22 @@ if ( $op eq 'addreport' ) { probpage => $place, ); - my $problemreport = $problem->unblessed; - $problemreport->{code} = 'PROBLEM_REPORT'; - $problemreport->{content} .= "\nUsername: $username"; - $problemreport->{content} .= "\nProblem page: $place"; - my $transport = 'email'; + # send notice to library + my $letter = C4::Letters::GetPreparedLetter( + module => 'members', + letter_code => 'PROBLEM_REPORT', + branchcode => $problem->branchcode, + tables => { + 'problem_reports', $problem->reportid + } + ); my $from_address = $member->email || $member->emailpro || $member->B_email || $koha_admin; + my $transport = 'email'; if ( $recipient eq 'admin' ) { C4::Letters::EnqueueLetter({ - letter => $problemreport, + letter => $letter, borrowernumber => $borrowernumber, message_transport_type => $transport, to_address => $koha_admin, @@ -110,7 +115,7 @@ if ( $op eq 'addreport' ) { C4::Context->preference('ReplytoDefault') || $library->branchemail; C4::Letters::EnqueueLetter({ - letter => $problemreport, + letter => $letter, borrowernumber => $borrowernumber, message_transport_type => $transport, to_address => $to_address, diff --git a/tools/letter.pl b/tools/letter.pl index c658dbf..6044243 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -261,6 +261,10 @@ sub add_form { if ( $module eq 'circulation' and $code and $code =~ /^AR_/ ) { push @{$field_selection}, add_fields('article_requests'); } + + if ( $module eq 'members' and $code and $code eq 'PROBLEM_REPORT' ) { + push @{$field_selection}, add_fields('problem_reports'); + } } my $preview_is_available = 0; -- 2.1.4