Bugzilla – Attachment 25912 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.82 KB, created by
Julian Maurice
on 2014-03-06 18:33:14 UTC
(
hide
)
Description:
Bug 11904: Example usage of new module Koha::Messages
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2014-03-06 18:33:14 UTC
Size:
7.82 KB
patch
obsolete
>From b901cd0763657125b4537f62704ae2e771e5497c 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 509cd1d..38d38a5 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -717,7 +717,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}, >@@ -764,6 +763,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 e667bc3..b1bbc78 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -127,6 +127,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); > [% IF ( borrowernumber ) %] > [% INCLUDE 'members-toolbar.inc' %] > [% END %] >+[% INCLUDE 'messages.inc' %] > > <!-- INITIAL BLOC : PARAMETERS & BORROWER INFO --> > <div style="display: none;" id="add_message_form"> >@@ -166,8 +167,6 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); > </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 c9fb845..9799ccf 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 c4705d1..26a9a74 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -182,12 +182,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> >@@ -358,11 +357,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 e794efa..b87624a 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -416,7 +416,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