From 3dfee57baaf83f31ab2e97da75217c57e74fa8a0 Mon Sep 17 00:00:00 2001 From: Morgane Alonso Date: Mon, 6 Jun 2016 12:24:56 +0000 Subject: [PATCH] Bug 12509 - Fix Untranslatable Restriction added by overdues process MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Changes the value of the "comment" column in "borrower_debarments" table from "Restriction added by overdues process yyyy-mm-dd hh:mm:ss" to "OVERDUE_PROCESS yyyy-mm-dd hh:mm:ss" in the overdue_notices.pl. Then in the templates "moremember.tt", "circulation.tt", "memberentrygen.tt", "opac-reserve.tt" and "opac-user.tt" the value of "comment" is check, if it's an automatical comment due to overdue process it'll write "Restriction added by overdues process yyyy-mm-dd hh:mm:ss", then if there is a customizable comment it will be written without modification. Like this, the comment "Restriction added by overdues process" is written in the po files and can be translated later. To test: 1) create a patron with automatical restriction due to overdue process; 2) apply patch; 3) run misc/cronjobs/overdue_notices.pl; 4) verify if the comment "Restriction added by overdues process" is well written and translatable on the following page : - opac patron home page (opac-user.tt); - opac item reservation page (opac-reserve.tt); - pro patron page (moremember.tt); - reservation item for a patron (circulation.tt, memberentrygen.tt); 5) try to translate the comment in po files; 6) sign off. Signed-off-by: Owen Leonard Signed-off-by: Kyle M Hall Signed-off-by: Kyle M Hall (cherry picked from commit a1285ba9c0f9a7020ba5f6e982dd2a5891ab9f63) Signed-off-by: Frédéric Demians (cherry picked from commit 17156342e629cea984c1ff411fc38a6b33512a42) Signed-off-by: Julian Maurice --- .../prog/en/includes/borrower_debarments.inc | 8 +++++++- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 7 ++++++- .../prog/en/modules/members/memberentrygen.tt | 8 +++++++- .../prog/en/modules/members/moremember.tt | 7 ++++++- .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 10 +++++++++- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 11 ++++++++++- misc/cronjobs/overdue_notices.pl | 3 +-- 7 files changed, 46 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc index aea088950d..d7177d4718 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -51,7 +51,13 @@ Discharge [% END %] - [% d.comment %] + + [% IF d.comment.search('OVERDUES_PROCESS') %] + Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %] + [% ELSE %] + [% d.comment %] + [% END %] + [% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] Indefinite [% END %] [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 5d79863b01..a867d7642c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -782,7 +782,12 @@ No patron matched [% message %] [% END %] [% IF ( debarredcomment ) %] - with the explanation:
[% debarredcomment | html_line_break %] + with the explanation:
+ [% IF debarredcomment.search('OVERDUES_PROCESS') %] + Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %] + [% ELSE %] + [% debarredcomment | html_line_break %] + [% END %] [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index ebb11501ef..16317ccdbe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -972,7 +972,13 @@ [% FOREACH d IN debarments %] [% d.type %] - [% d.comment %] + + [% IF d.comment.search('OVERDUES_PROCESS') %] + Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %] + [% ELSE %] + [% d.comment %] + [% END %] + [% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] Indefinite [% END %] [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 7b662b4614..c0c70deb9f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -183,7 +183,12 @@ function validate1(date) { [% END %] [% IF ( debarredcomment ) %] - with the explanation: [% debarredcomment | html_line_break %] + with the explanation: + [% IF debarredcomment.search('OVERDUES_PROCESS') %] + Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %] + [% ELSE %] + [% debarredcomment | html_line_break %] + [% END %] [% END %] View restrictions diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 516ada50d9..b8a3aa262f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -40,7 +40,15 @@ [% IF ( debarred ) %]
  • Your account has been frozen. - [% IF debarred_comment %] Comment: "[% debarred_comment %]"[% END %] + [% IF debarred_comment %] Comment: " + [% IF debarred_comment.search('OVERDUES_PROCESS') %] + Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %] + [% ELSE %] + [% debarred_comment | html_line_break %] + [% END %] + + [% END %] + [% IF debarred_date && debarred_date != '9999-12-31' %] End date: [% debarred_date | $KohaDates %][% END %]
    Usually the reason for freezing an account is old overdues or damage fees. If shows your account to be clear, please contact the library. Go to your account page
  • diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 9fb7b52236..1f86b0d520 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -89,7 +89,16 @@
      [% IF ( userdebarred ) %] -
    • Please note: Your account has been frozen[% IF ( BORROWER_INFO.userdebarreddate ) %] until [% BORROWER_INFO.userdebarreddate | $KohaDates %][% END %][% IF ( BORROWER_INFO.debarredcomment ) %] with the comment "[% BORROWER_INFO.debarredcomment %]"[% END %]. Usually the reason for freezing an account is old overdues or damage fees. If your account page shows your account to be clear, please contact the library.
    • +
    • Please note: Your account has been frozen[% IF ( BORROWER_INFO.userdebarreddate ) %] until [% BORROWER_INFO.userdebarreddate | $KohaDates %][% END %] + [% IF ( BORROWER_INFO.debarredcomment ) %] with the comment + + [% IF BORROWER_INFO.debarredcomment.search('OVERDUES_PROCESS') %] + "Restriction added by overdues process [% BORROWER_INFO.debarredcomment.remove('OVERDUES_PROCESS ') %]" + [% ELSE %] + [% BORROWER_INFO.debarredcomment %] + [% END %] + + [% END %]. Usually the reason for freezing an account is old overdues or damage fees. If your account page shows your account to be clear, please contact the library.
    • [% END %] [% IF ( BORROWER_INFO.gonenoaddress ) %]
    • Please note: According to our records, we don't have up-to-date [% UNLESS OPACPatronDetails %]contact information[% ELSE %]contact information[% END %] on file. Please contact the library[% IF OPACPatronDetails %] or use the online update form to submit current information (Please note: there may be a delay in restoring your account if you submit online)[% END %].
    • diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index d0974db819..ec4c6c154f 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -596,8 +596,7 @@ END_SQL { borrowernumber => $borrowernumber, type => 'OVERDUES', - comment => "Restriction added by overdues process " - . output_pref( dt_from_string() ), + comment => "OVERDUES_PROCESS " . output_pref( dt_from_string() ), } ); $verbose and warn "debarring $borr\n"; -- 2.39.5