Bugzilla – Attachment 62638 Details for
Bug 14224
patron notes about item shown at check in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14224: Make strings translatable
Bug-14224-Make-strings-translatable.patch (text/plain), 6.10 KB, created by
Jonathan Druart
on 2017-04-24 19:06:23 UTC
(
hide
)
Description:
Bug 14224: Make strings translatable
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-24 19:06:23 UTC
Size:
6.10 KB
patch
obsolete
>From 07680b5779ee3601344105ed0a928b76e6ef1622 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 1 Feb 2017 16:38:37 +0100 >Subject: [PATCH] Bug 14224: Make strings translatable >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The strings should be translatable. >This patch also removes the error as it appears that we only have 1 >error. >To improve we could surround the store with an eval. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 18 ++++++++---------- > opac/svc/patron_notes | 11 +++-------- > 2 files changed, 11 insertions(+), 18 deletions(-) > >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 8f0cc94..8424536 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -925,9 +925,9 @@ Using this account is not recommended because some parts of Koha will not functi > > if(origvalue != value) { > if(origvalue != "") >- $btn_save.text('Submit changes'); >+ $btn_save.text(_("Submit changes")); > else >- $btn_save.text('Submit note'); >+ $btn_save.text(_("Submit note")); > $btn_save.show(); > } else { > $btn_save.hide(); >@@ -958,30 +958,28 @@ Using this account is not recommended because some parts of Koha will not functi > $("#notesaved").addClass("alert-info"); > $noteinput.data('origvalue', data.note); > $noteinput.val(data.note); >- message = "<p>Your note about " + title + " has been saved and sent to the library.</p>"; >+ message = "<p>" + _("Your note about %s has been saved and sent to the library.").format(title) + "</p>"; >+ message += "<p style=\"font-style:italic;\">" + data.note + "</p>"; > $self.hide(); > } else if(data.status == 'removed') { > $("#notesaved").removeClass("alert-error"); > $("#notesaved").addClass("alert-info"); > $noteinput.data('origvalue', ""); > $noteinput.val(""); >- message = "<p>Your note about " + title + " was removed.</p>"; >+ message = "<p>" + _("Your note about %s was removed.").format(title) + "</p>"; > $self.hide(); > } else { > $("#notesaved").removeClass("alert-info"); > $("#notesaved").addClass("alert-error"); >- message = "<p>Your note about " + title + " could not be saved.</p>" + >- "<p style=\"font-weight:bold;\">" + data.error + "</p>"; >+ message = "<p>" + _("Your note about %s could not be saved.").format(title) + "</p>"; >+ message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>"; > } >- >- message += "<p style=\"font-style:italic;\">" + data.note + "</p>"; > $("#notesaved").html(message); > }) > .fail(function(data) { > $("#notesaved").removeClass("alert-info"); > $("#notesaved").addClass("alert-error"); >- var message = "<p>Your note about " + title + " could not be saved.</p>" + >- "<p style=\"font-weight:bold;\">Ajax request has failed.</p>"; >+ var message = "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>"; > $("#notesaved").html(message); > }) > .always(function() { >diff --git a/opac/svc/patron_notes b/opac/svc/patron_notes >index 5a103d7..2e25b36 100755 >--- a/opac/svc/patron_notes >+++ b/opac/svc/patron_notes >@@ -56,7 +56,6 @@ if ($is_ajax) { > my $issue_id = $query->param('issue_id'); > my $clean_note = $scrubber->scrub($note); > my $status = "saved"; >- my $error = ""; > my ($member, $issue); > > my ( $template, $borrowernumber, $cookie ) = C4::Auth::get_template_and_user({ >@@ -72,14 +71,11 @@ if ($is_ajax) { > $issue = Koha::Checkouts->find($issue_id); > if ( $issue->borrowernumber != $borrowernumber ) { > $status = "fail"; >- $error = "Invalid issue id!"; > } >- } else { >- $status = "fail"; >- $error = "Invalid issue id!"; > } > >- if ( (not $error) && $issue->set({ notedate => dt_from_string(), note => $clean_note })->store ) { >+ if ( $issue ) { >+ $issue->set({ notedate => dt_from_string(), note => $clean_note })->store; > if($clean_note) { # only send email if note not empty > my $branch = Koha::Libraries->find( $issue->branchcode ); > my $biblio = GetBiblioFromItemNumber($issue->itemnumber); >@@ -98,10 +94,9 @@ if ($is_ajax) { > } > } else { > $status = "fail"; >- $error = "Perhaps the item has already been checked in?"; > } > >- my $response = "{\"status\": \"$status\", \"note\": \"$clean_note\", \"issue_id\": \"$issue_id\", \"error\": \"$error\"}"; >+ my $response = "{\"status\": \"$status\", \"note\": \"$clean_note\", \"issue_id\": \"$issue_id\"}"; > output_with_http_headers($query, undef, $response, 'js'); > exit; > } # END Issue Note >-- >2.1.4
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 14224
:
41801
|
41921
|
56682
|
57440
|
57577
|
57763
|
57802
|
57829
|
57853
|
58277
|
58325
|
58326
|
58372
|
58606
|
58622
|
59469
|
59637
|
59641
|
59761
|
59779
|
59780
|
59781
|
59782
|
59783
|
59784
|
59785
|
59786
|
59787
|
59788
|
59796
|
59798
|
59799
|
59800
|
59801
|
59802
|
59803
|
59804
|
59805
|
59806
|
61847
|
61848
|
61849
|
61850
|
61851
|
61852
|
61853
|
61854
|
61855
|
61856
|
62196
|
62197
|
62198
|
62199
|
62200
|
62201
|
62202
|
62203
|
62204
|
62205
|
62206
|
62633
|
62634
|
62635
|
62636
|
62637
| 62638 |
62639
|
62640
|
62641
|
62642
|
62643
|
62644