Bug 12224: (follow-up) Switching to TT notice
authorAleisha Amohia <aleishaamohia@hotmail.com>
Wed, 2 Dec 2020 22:04:23 +0000 (11:04 +1300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 5 Mar 2021 12:49:03 +0000 (13:49 +0100)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/atomicupdate/bug_12224-add_CHECKINSLIP_notice.perl
installer/data/mysql/en/mandatory/sample_notices.yml
installer/data/mysql/fr-CA/obligatoire/sample_notices.sql
installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
installer/data/mysql/it-IT/necessari/notices.sql
installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql
installer/data/mysql/pl-PL/mandatory/sample_notices.sql
installer/data/mysql/ru-RU/mandatory/sample_notices.sql
installer/data/mysql/uk-UA/mandatory/sample_notices.sql
members/printslip.pl

index fc33a72..6edfbc9 100644 (file)
@@ -2,19 +2,20 @@ $DBversion = 'XXX';
 if( CheckVersion( $DBversion ) ) {
     $dbh->do(q{ INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type) VALUES
         ('circulation','CHECKINSLIP','','Checkin slip',1,'Checkin slip',
-"<h3><<branches.branchname>></h3>
-Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-(<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
 
-<<today>><br />
+[% today %]<br />
 
 <h4>Checked in today</h4>
-<checkedin>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
 <p>
-<<biblio.title>> <br />
-Barcode: <<items.barcode>><br />
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
 </p>
-</checkedin>",
+[% END %]",
         'print')
     });
 
index 9d4f02e..52d68c6 100644 (file)
@@ -1464,16 +1464,17 @@ tables:
           message_transport_type: print
           lang: default
           content:
-            - "<h3><<branches.branchname>></h3>"
-            - "Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />"
-            - "(<<borrowers.cardnumber>>) <br />"
+            - "<h3>[% branch.branchname %]</h3>"
+            - "Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />"
+            - "([% borrower.cardnumber %]) <br />"
             - ""
-            - "<<today>><br />"
+            - "[% today %]<br />"
             - ""
             - "<h4>Checked in today</h4>"
-            - "<checkedin>"
+            - "[% FOREACH checkin IN old_checkouts %]"
+            - "[% SET item = checkin.item %]"
             - "<p>"
-            - "<<biblio.title>> <br />"
-            - "Barcode: <<items.barcode>><br />"
+            - "[% item.biblio.title %] <br />"
+            - "Barcode: [% item.barcode %] <br />"
             - "</p>"
-            - "</checkedin>"
+            - "[% END %]"
index d8d4f40..44bfec6 100644 (file)
@@ -23,19 +23,20 @@ INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, m
 ('suggestions','AVAILABLE','','Suggestion d\'achat disponible',0,'Suggestion d\'achat disponible','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons le plaisir de vous informer que le document fait aujourd\'hui partie de nos collection et qu\'il est disponible à la bibliothèque.\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'),
 ('suggestions','ORDERED','','Suggestion d\'achat commandée',0,'Suggestion d\'achat commandée','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons le plaisir de vous informer que le document a été commandé.\r\n\r\nVous recevrez une nouvelle notification quand le document sera disponible à bibliothèque.\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'),
 ('suggestions','REJECTED','','Suggestion d\'achat rejetée',0,'Suggestion d\'achat rejetée','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons évalué votre suggestion aujourd\'hui et décidé de ne pas l\'acheter cette fois.\r\n\r\nLa raison de notre refus est : <<suggestions.reason>>\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'),
-('circulation','CHECKINSLIP','','Checkin slip',1,'Checkin slip',"<h3><<branches.branchname>></h3>
-Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-(<<borrowers.cardnumber>>) <br />
+('circulation','CHECKINSLIP','','Checkin slip',1,'Checkin slip',"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
 
-<<today>><br />
+[% today %]<br />
 
 <h4>Checked in today</h4>
-<checkedin>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
 <p>
-<<biblio.title>> <br />
-Barcode: <<items.barcode>><br />
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
 </p>
-</checkedin>", 'print');
+[% END %]", 'print');
 
 INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
 VALUES ('suggestions','NEW_SUGGESTION','Nouvelle suggestion','Nouvelle suggestion','<h3>Suggestion en attente</h3>
index 5e1b68c..1eac379 100644 (file)
@@ -52,19 +52,20 @@ VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Su
     </ul>
     </p>',1, 'email'),
     ('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
-    "<h3><<branches.branchname>></h3>
-    Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-    (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
 
-    <<today>><br />
+[% today %]<br />
 
-    <h4>Checked in today</h4>
-    <checkedin>
-    <p>
-    <<biblio.title>> <br />
-    Barcode: <<items.barcode>><br />
-    </p>
-    </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
 
 INSERT INTO `letter` (module, code, name, title, content, is_html)
 VALUES ('circulation','ISSUESLIP','Ticket de de prêt','Ticket de prêt', '<h3><<branches.branchname>></h3>
index 2deffe4..681f5f7 100644 (file)
@@ -57,19 +57,20 @@ VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Su
     </ul>
     </p>',1, 'email'),
     ('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
-    "<h3><<branches.branchname>></h3>
-    Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-    (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
 
-    <<today>><br />
+[% today %]<br />
 
-    <h4>Checked in today</h4>
-    <checkedin>
-    <p>
-    <<biblio.title>> <br />
-    Barcode: <<items.barcode>><br />
-    </p>
-    </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
 
 INSERT INTO letter (module, code, name, title, content, is_html)
 VALUES ('circulation','ISSUESLIP','Ricevuta di prestito','Ricevuta di prestito', '<h3><<branches.branchname>></h3>
index 1e05637..9ae18e9 100644 (file)
@@ -72,19 +72,20 @@ VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Su
     </ul>
     </p>',1, 'email'),
     ('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
-    "<h3><<branches.branchname>></h3>
-    Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-    (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
 
-    <<today>><br />
+[% today %]<br />
 
-    <h4>Checked in today</h4>
-    <checkedin>
-    <p>
-    <<biblio.title>> <br />
-    Barcode: <<items.barcode>><br />
-    </p>
-    </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
 
 INSERT INTO `letter` (module, code, name, title, content, is_html)
 VALUES ('circulation','ISSUESLIP','Utlån','Utlån', '<h3><<branches.branchname>></h3>
index e320733..21de6f2 100644 (file)
@@ -51,19 +51,20 @@ VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Su
     </ul>
     </p>',1, 'email'),
     ('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
-    "<h3><<branches.branchname>></h3>
-    Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-    (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
 
-    <<today>><br />
+[% today %]<br />
 
-    <h4>Checked in today</h4>
-    <checkedin>
-    <p>
-    <<biblio.title>> <br />
-    Barcode: <<items.barcode>><br />
-    </p>
-    </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
 
 INSERT INTO `letter` (module, code, name, title, content, is_html)
 VALUES ('circulation','ISSUESLIP','Issue slip','Issue slip', '<h3><<branches.branchname>></h3>
index 8341257..52f7fdb 100644 (file)
@@ -50,19 +50,20 @@ VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Su
     </ul>
     </p>',1, 'email'),
     ('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
-    "<h3><<branches.branchname>></h3>
-    Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-    (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
 
-    <<today>><br />
+[% today %]<br />
 
-    <h4>Checked in today</h4>
-    <checkedin>
-    <p>
-    <<biblio.title>> <br />
-    Barcode: <<items.barcode>><br />
-    </p>
-    </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
 
 INSERT INTO `letter` (module, code, name, title, content, is_html)
 VALUES ('circulation','ISSUESLIP','Issue slip','Issue slip', '<h3><<branches.branchname>></h3>
index 857a1a9..713810d 100644 (file)
@@ -115,19 +115,20 @@ VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Su
     </ul>
     </p>',1, 'email'),
     ('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
-    "<h3><<branches.branchname>></h3>
-    Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-    (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
 
-    <<today>><br />
+[% today %]<br />
 
-    <h4>Checked in today</h4>
-    <checkedin>
-    <p>
-    <<biblio.title>> <br />
-    Barcode: <<items.barcode>><br />
-    </p>
-    </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
 
 INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES
 ('members', 'DISCHARGE', 'підтвердження на розрахування',
index 389f5a6..6d04ed8 100755 (executable)
@@ -88,7 +88,7 @@ if ( $print eq 'checkinslip' ) {
     my $today_end = dt_from_string->set( hour => 23, minute => 59, second => 0 );
     $today_start = Koha::Database->new->schema->storage->datetime_parser->format_datetime( $today_start );
     $today_end = Koha::Database->new->schema->storage->datetime_parser->format_datetime( $today_end );
-    my $todays_checkins = Koha::Old::Checkouts->search({
+    my @todays_checkins = Koha::Old::Checkouts->search({
         returndate => {
             '>=' => $today_start,
             '<=' => $today_end,
@@ -97,15 +97,8 @@ if ( $print eq 'checkinslip' ) {
         branchcode => $checkinslip_branch,
     });
 
-    my @checkins;
-    while ( my $c = $todays_checkins->next ) {
-        push @checkins, {
-            biblio => $c->item->biblio->unblessed,
-            items => $c->item->unblessed,
-        };
-    }
-    my %repeat = (
-        checkedin => \@checkins,
+    my %loops = (
+        old_issues => [ map { $_->issue_id } @todays_checkins ],
     );
 
     my $letter = C4::Letters::GetPreparedLetter(
@@ -116,7 +109,7 @@ if ( $print eq 'checkinslip' ) {
             branches => $checkinslip_branch,
             borrowers => $borrowernumber,
         },
-        repeat => \%repeat,
+        loops => \%loops,
         message_transport_type => 'print'
     );