Bugzilla – Attachment 22351 Details for
Bug 2546
Description of charges: string hardcoded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2546: Description of charges is not translatable
Bug-2546-Description-of-charges-is-not-translatabl.patch (text/plain), 9.79 KB, created by
Marcel de Rooy
on 2013-10-24 10:59:48 UTC
(
hide
)
Description:
Bug 2546: Description of charges is not translatable
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-10-24 10:59:48 UTC
Size:
9.79 KB
patch
obsolete
>From 87c583a966eaa25edba2ff195ac9e3893befa89a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 23 Oct 2013 12:40:30 +0200 >Subject: [PATCH] Bug 2546: Description of charges is not translatable >Content-Type: text/plain; charset=utf-8 > >The descriptions for charges are stored in English in the DB >(accountlines.description). So they are not translatable. > >This patch removes the descriptions automatically added and generates >the string in the template. > >Test plan: >1/ Execute the updatedatabase entry. >2/ Verify in the following pages the description is consistent: > - members/pay.pl?borrowernumber=XXXX > - members/boraccount.pl?borrowernumber=XXXX > - opac-account.pl >3/ Launch the translate script and update the po files in order to >translate the new strings. >4/ Verify the strings are translated in the interface. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Works as advertised. Corrected few typos in the commit message. >--- > C4/Accounts.pm | 39 ++------------------ > installer/data/mysql/updatedatabase.pl | 20 ++++++++++ > .../prog/en/modules/members/boraccount.tt | 14 +++++++- > .../intranet-tmpl/prog/en/modules/members/pay.tt | 15 +++++++- > .../opac-tmpl/prog/en/modules/opac-account.tt | 16 +++++++- > 5 files changed, 65 insertions(+), 39 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 4b4ae04..eed96ac 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -146,7 +146,7 @@ sub recordpayment { > my $usth = $dbh->prepare( > "INSERT INTO accountlines > (borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) >- VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)" >+ VALUES (?,?,now(),?,'','Pay',?,?)" > ); > $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id ); > >@@ -208,7 +208,7 @@ sub makepayment { > my $udp = > $dbh->prepare( > "UPDATE accountlines >- SET amountoutstanding = 0, description = 'Payment,thanks' >+ SET amountoutstanding = 0 > WHERE accountlines_id = ? > " > ); >@@ -231,7 +231,7 @@ sub makepayment { > $dbh->prepare( > "INSERT > INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note) >- VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?, ?)" >+ VALUES ( ?, ?, now(), ?, ?, '', 'Pay', 0, ?, ?)" > ); > $ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note); > } >@@ -413,37 +413,6 @@ sub manualinvoice { > my $accountno = getnextacctno($borrowernumber); > my $amountleft = $amount; > >-# if ( $type eq 'CS' >-# || $type eq 'CB' >-# || $type eq 'CW' >-# || $type eq 'CF' >-# || $type eq 'CL' ) >-# { >-# my $amount2 = $amount * -1; # FIXME - $amount2 = -$amount >-# $amountleft = >-# fixcredit( $borrowernumber, $amount2, $itemnum, $type, $user ); >-# } >- if ( $type eq 'N' ) { >- $desc .= " New Card"; >- } >- if ( $type eq 'F' ) { >- $desc .= " Fine"; >- } >- if ( $type eq 'A' ) { >- $desc .= " Account Management fee"; >- } >- if ( $type eq 'M' ) { >- $desc .= " Sundry"; >- } >- >- if ( $type eq 'L' && $desc eq '' ) { >- >- $desc = " Lost Item"; >- } >-# if ( $type eq 'REF' ) { >-# $desc .= " Cash Refund"; >-# $amountleft = refund( '', $borrowernumber, $amount ); >-# } > if ( ( $type eq 'L' ) > or ( $type eq 'F' ) > or ( $type eq 'A' ) >@@ -835,7 +804,7 @@ sub recordpayment_selectaccts { > # create new line > $sql = 'INSERT INTO accountlines ' . > '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' . >- q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?,?)|; >+ q|VALUES (?,?,now(),?,'','Pay',?,?,?)|; > $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note ); > UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno ); > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 9f57eff..42a71c2 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7306,6 +7306,26 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+ >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ >+ UPDATE accountlines >+ SET description = '' >+ WHERE description IN ( >+ ' New Card', >+ ' Fine', >+ ' Sundry', >+ 'Writeoff', >+ ' Account Management fee', >+ 'Payment,thanks', 'Payment,thanks - ', >+ ' Lost Item' >+ ) >+ }); >+ print "Upgrade to $DBversion done (Bug 2546: Update fine descriptions)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index d64c63b..ca9c63a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -44,7 +44,19 @@ > > [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %] > <td>[% account.date %]</td> >- <td>[% account.description %] [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&itemnumber=[% account.itemnumber %]">View item</a> [% END %][% account.title |html %]</td> >+ <td> >+ [% SWITCH account.accounttype %] >+ [% CASE 'Pay' %]Payment,thanks >+ [% CASE 'N' %]New Card >+ [% CASE 'F' %]Fine >+ [% CASE 'A' %]Account management fee >+ [% CASE 'M' %]Sundry >+ [% CASE 'L' %]Lost Item >+ [% CASE 'W' %]Writeoff >+ [% CASE %][% account.accounttype %] >+ [%- END -%] >+ [%- IF account.description %], [% account.description %][% END %] >+ [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&itemnumber=[% account.itemnumber %]">View item</a> [% END %][% account.title |html %]</td> > <td>[% account.note | html_line_break %]</td> > [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td> > [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding %]</td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >index 91f1609..23203b1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -112,7 +112,20 @@ function enableCheckboxActions(){ > <input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" /> > <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" /> > </td> >- <td>[% line.description %] ([% line.title |html_entity %])</td> >+ <td> >+ [% SWITCH line.accounttype %] >+ [% CASE 'Pay' %]Payment,thanks >+ [% CASE 'N' %]New Card >+ [% CASE 'F' %]Fine >+ [% CASE 'A' %]Account management fee >+ [% CASE 'M' %]Sundry >+ [% CASE 'L' %]Lost Item >+ [% CASE 'W' %]Writeoff >+ [% CASE %][% line.accounttype %] >+ [%- END -%] >+ [%- IF line.description %], [% line.description %][% END %] >+ [% IF line.title %]([% line.title |html_entity %])[% END %] >+ </td> > <td><input type="text" name="payment_note_[% line.accountno %]" /></td> > <td>[% line.accounttype %]</td> > <td>[% line.notify_id %]</td> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt >index bb858e8..47169e8 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt >@@ -39,8 +39,20 @@ > [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %] > [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] > <td>[% ACCOUNT_LINE.date | $KohaDates %]</td> >- <td>[% ACCOUNT_LINE.description %] >- [% IF ( ACCOUNT_LINE.title ) %][% ACCOUNT_LINE.title |html %][% END %]</td> >+ <td> >+ [% SWITCH ACCOUNT_LINE.accounttype %] >+ [% CASE 'Pay' %]Payment,thanks >+ [% CASE 'N' %]New Card >+ [% CASE 'F' %]Fine >+ [% CASE 'A' %]Account management fee >+ [% CASE 'M' %]Sundry >+ [% CASE 'L' %]Lost Item >+ [% CASE 'W' %]Writeoff >+ [% CASE %][% ACCOUNT_LINE.accounttype %] >+ [%- END -%] >+ [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %] >+ [% IF line.title %]([% line.title |html_entity %])[% END %] >+ </td> > [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td> > [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td> > </tr> >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2546
:
2243
|
3070
|
22307
|
22351
|
23079