Bugzilla – Attachment 30581 Details for
Bug 11904
Proposal for a uniform way to send messages to user interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11904: Example usage of new module Koha::Messages
Bug-11904-Example-usage-of-new-module-KohaMessages.patch (text/plain), 7.72 KB, created by
Julian Maurice
on 2014-08-07 13:50:55 UTC
(
hide
)
Description:
Bug 11904: Example usage of new module Koha::Messages
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2014-08-07 13:50:55 UTC
Size:
7.72 KB
patch
obsolete
>From a8322bb8414f796732ee72ac840ea3774a0b679f Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 20 Feb 2014 23:56:04 +0100 >Subject: [PATCH] Bug 11904: Example usage of new module Koha::Messages > >Test plan: >1/ Go to members/moremember.pl >2/ Click on "More" -> "Renew patron" and confirm >3/ A message should appear "Patron's account has been renewed until ..." >4/ In a shell, go to misc/translator and run > ./translate create fr-FR (or ./translate update fr-FR) > ./translate install fr-FR > (you can use your own language of course) >5/ Edit po/fr-FR-messages.po and translate the string "Patron's account > has been renewed until ..." >6/ In staff interface change language to French and renew patron once >again. >7/ The translated message should appear. > >Needs patches from bugs 8044 and 11848 for string translation >--- > circ/circulation.pl | 2 +- > .../prog/en/includes/members-toolbar.inc | 2 +- > .../prog/en/modules/circ/circulation.tt | 3 +-- > .../prog/en/modules/members/moremember-brief.tt | 6 +----- > .../prog/en/modules/members/moremember.tt | 9 ++------- > members/moremember.pl | 1 - > members/setstatus.pl | 19 +++++++++---------- > 7 files changed, 15 insertions(+), 27 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index c766e88..8d67046 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -514,7 +514,6 @@ $template->param( > surname => $borrower->{'surname'}, > showname => $borrower->{'showname'}, > category_type => $borrower->{'category_type'}, >- was_renewed => $query->param('was_renewed') ? 1 : 0, > expiry => format_date($borrower->{'dateexpiry'}), > categorycode => $borrower->{'categorycode'}, > categoryname => $borrower->{description}, >@@ -557,6 +556,7 @@ $template->param( > if ($stickyduedate) { > $session->param( 'stickyduedate', $duedatespec ); > } >+$session->flush; > > my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index caa2fbf..9404f97 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -69,7 +69,7 @@ function update_child() { > function confirm_reregistration() { > var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?")); > if (is_confirmed) { >- window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&desintation=[% destination %]&reregistration=y'; >+ window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&destination=[% destination %]&reregistration=y'; > } > } > function export_barcodes() { >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 fd65b02..e041428 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -85,6 +85,7 @@ $(document).ready(function() { > [% IF ( borrowernumber ) %] > [% INCLUDE 'members-toolbar.inc' %] > [% END %] >+[% INCLUDE 'messages.inc' %] > > <!-- INITIAL BLOC : PARAMETERS & BORROWER INFO --> > <div style="display: none;" id="add_message_form"> >@@ -124,8 +125,6 @@ $(document).ready(function() { > </form> > </div> > >-[% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% expiry %]</div>[% END %] >- > [% IF additional_materials %] > <div id="materials" class="dialog message">Note about the accompanying materials: <br /> > [% additional_materials %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt >index 57e4d49..eb25ab5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt >@@ -76,11 +76,7 @@ > <li><span class="label">Category: </span>[% description %] ([% categorycode %])</li> > <li><span class="label">Registration date: </span>[% dateenrolled %]</li> > <li><span class="label">Expiration date: </span> >- [% IF ( was_renewed ) %] >- <strong class="reregistrinfo">[% dateexpiry %]</strong> >- [% ELSE %] >- [% dateexpiry %] >- [% END %] >+ [% dateexpiry %] > </li> > <li><span class="label">Library: </span>[% branchname %]</li> > >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 cf4cd8c..18e3560 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -149,12 +149,11 @@ function validate1(date) { > </div> > [% END %] > <div class="yui-g"> >+ [% INCLUDE 'messages.inc' %] > > [% IF ( unknowuser ) %] > <div class="dialog message">This patron does not exist.</div> > [% ELSE %] >- [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry %]</div>[% END %] >- > [% IF ( flagged ) %] > <div id="circmessages" class="circmessage attention"> > <ul> >@@ -324,11 +323,7 @@ function validate1(date) { > <li><span class="label">Registration date: </span>[% dateenrolled %]</li> > > <li><span class="label">Expiration date: </span> >- [% IF ( was_renewed ) %] >- <strong class="reregistrinfo">[% dateexpiry %]</strong> >- [% ELSE %] >- [% dateexpiry %] >- [% END %] >+ [% dateexpiry %] > </li> > > <li><span class="label">Library: </span>[% branchname %]</li> >diff --git a/members/moremember.pl b/members/moremember.pl >index b1df1dd..de51356 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -351,7 +351,6 @@ $template->param( > borrowernumber => $borrowernumber, > othernames => $data->{'othernames'}, > categoryname => $data->{'description'}, >- was_renewed => $input->param('was_renewed') ? 1 : 0, > branch => $branch, > todaysdate => C4::Dates->today(), > totalprice => sprintf("%.2f", $totalprice), >diff --git a/members/setstatus.pl b/members/setstatus.pl >index 2c13401..4001746 100755 >--- a/members/setstatus.pl >+++ b/members/setstatus.pl >@@ -31,6 +31,9 @@ use C4::Context; > use C4::Members; > use C4::Auth; > >+use Koha::I18N; >+use Koha::Messages; >+use Koha::DateUtils; > > my $input = new CGI; > >@@ -54,16 +57,12 @@ if ( $reregistration eq 'y' ) { > $sth->finish; > } > >+if ($dateexpiry) { >+ $dateexpiry = output_pref({dt => dt_from_string($dateexpiry, 'iso'), dateonly => 1}); >+ messages_set(gettext("Patron's account has been renewed until %1", $dateexpiry)); >+} > if($destination eq "circ"){ >- if($dateexpiry){ >- print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber&was_renewed=1"); >- } else { >- print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber"); >- } >+ print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber"); > } else { >- if($dateexpiry){ >- print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&was_renewed=1"); >- } else { >- print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); >- } >+ print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); > } >-- >1.7.10.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 11904
:
25910
|
25911
|
25912
|
27940
|
27941
|
27942
|
29545
|
29546
|
29547
|
29552
|
29553
|
29554
|
30579
|
30580
|
30581
|
38522
|
38523
|
38524
|
40960
|
40961
|
40962
|
48415
|
48416
|
48417
|
48418
|
49059
|
49060
|
49061
|
49263
|
49264
|
49265