[Patches] [PATCH] Bug 7334: Improve 'no address stored' and similar messages

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Sat Dec 10 01:05:22 NZDT 2011


From: Katrin Fischer <Katrin.Fischer.83 at web.de>
Date: Thu, 8 Dec 2011 07:19:05 +0100
Subject: [PATCH] Bug 7334: Improve 'no address stored' and similar messages
 in patron account
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- 'no address stored' is now only displayed when first and second line
  of the address are empty
- added id's to all 3 possible messages so people can change or hide
  them

To test:

1) Check 'no address stored' shows only up when address fields are both
   empty
2) Check address is still correctly displayed

Note: make sure you check the 'checkouts' and other tabs, because there
are 2 different include files used here.

Signed-off-by: Frédéric Demians <f.demians at tamil.fr>

I confirm the bug and the solution. Text messages identification for
customization with JavaScript is a plus.
---
 .../intranet-tmpl/prog/en/includes/circ-menu.inc   |   20 ++++++++++--------
 .../intranet-tmpl/prog/en/includes/circ-menu.tt    |   21 +++++++++++--------
 2 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
index 6556562..da3d018 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
@@ -12,19 +12,21 @@
 <li><img src="/intranet-tmpl/prog/img/patron-blank.png" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li>
 [% END %]
 [% END %]
-    <li>[% IF ( address ) %]
-            [% address %]
+    [% IF ( address or address2 ) %]
+        [% IF ( address ) %]
+            <li>[% address %]</li>
+        [% END %]
+        [% IF ( address2 ) %]
+            <li>[% address2 %]</li>
+        [% END %]
     [% ELSE %]
-            <span class="empty">No address stored.</span>
-    [% END %]</li>
-    [% IF ( address2 ) %]
-        <li>[% address2 %]</li>
-    [% END %]<li> 
+            <li><span class="empty" id="noadressstored">No address stored.</span></li>
+    [% END %]
     [% IF ( city ) %]
             [% city %][% IF ( state ) %], [% state %][% END %]
 	    [% zipcode %][% IF ( country ) %], [% country %][% END %]
     [% ELSE %]
-        <span class="empty">No city stored.</span>
+        <span class="empty" id="nocitystored">No city stored.</span>
     [% END %]</li>
     <li>[% IF ( phone ) %]
         [% phone %]
@@ -35,7 +37,7 @@
             [% IF ( phonepro ) %]
                 [% phonepro %]
             [% ELSE %]
-                <span class="empty">No phone stored.</span>    
+                <span class="empty" id="nophonestored">No phone stored.</span>    
             [% END %]
         [% END %]
     [% END %]</li>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt
index fe04b63..451cd98 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt
@@ -14,19 +14,22 @@ in the global namespace %]
 <li><img src="/intranet-tmpl/prog/img/patron-blank.png" alt="[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li>
 [% END %]
 [% END %]
-    <li>[% IF borrower.address %]
-            [% borrower.address %]
+    [% IF ( borrower.address or borrower.address2 ) %]
+        [% IF ( borrower.address ) %]
+            <li>[% borrower.address %]</li>
+        [% END %]
+        [% IF ( borrower.address2 ) %]
+            <li>[% borrower.address2 %]</li>
+        [% END %]
     [% ELSE %]
-            <span class="empty">No address stored.</span>
-    [% END %]</li>
-    [% IF borrower.address2 %]
-        <li>[% borrower.address2 %]</li>
-    [% END %]<li>
+            <li><span class="empty" id="noaddressstored">No address stored.</span></li>
+    [% END %]
+    <li>
     [% IF borrower.city %]
             [% borrower.city %][% IF borrower.state %], [% borrower.state %][% END %]
 	    [% borrower.zipcode %][% IF ( borrower.country ) %], [% borrower.country %][% END %]
     [% ELSE %]
-        <span class="empty">No city stored.</span>
+        <span class="empty" id="nocitystored">No city stored.</span>
     [% END %]</li>
     <li>[% IF borrower.phone %]
         [% borrower.phone %]
@@ -37,7 +40,7 @@ in the global namespace %]
             [% IF borrower.phonepro %]
                 [% borrower.phonepro %]
             [% ELSE %]
-                <span class="empty">No phone stored.</span>
+                <span class="empty" id="nophonestored">No phone stored.</span>
             [% END %]
         [% END %]
     [% END %]</li>
-- 
1.7.8




More information about the Patches mailing list