Bug 9032: (follow-up) loop variable and Cancel button
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Wed, 19 Mar 2014 15:56:23 +0000 (16:56 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 20 Apr 2014 21:26:21 +0000 (21:26 +0000)
[1] Use loop variable instead of $_ in opac-shareshelf.pl
[2] Adds Cancel button to Invite form (prog and bootstrap) in
    opac-shareshelf.tt.  Likewise adds Return link under an error
    message in opac-shareshelf.tt.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-shareshelf.tt
opac/opac-shareshelf.pl

index 433b17a..b446252 100644 (file)
@@ -40,6 +40,7 @@
         [% IF errcode==6 %]<div class="alert">Sorry, but you did not enter any valid email address.</div>[% END %]
         [% IF errcode==7 %]<div class="alert">Sorry, but we could not accept this key. The invitation may have expired. Contact the patron who sent you the invitation.</div>[% END %]
         [% IF errcode==8 %]<div class="alert">As owner of a list you cannot accept an invitation for sharing it.</div>[% END %]
+        <p><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Return to your lists</a></p>
 
     [% ELSIF op=='invite' %]
         <div id="invite">
@@ -57,6 +58,7 @@
         </fieldset>
         <fieldset class="action">
             <input type="submit" value="Send" class="btn" />
+            <a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves" class="cancel">Cancel</a>
         </fieldset>
         </form>
         </div>
index 9d00492..074425c 100644 (file)
@@ -21,6 +21,7 @@
         [% IF errcode==6 %]<div class="dialog alert">Sorry, but you did not enter any valid email address.</div>[% END %]
         [% IF errcode==7 %]<div class="dialog alert">Sorry, but we could not accept this key. The invitation may have expired. Contact the patron who sent you the invitation.</div>[% END %]
         [% IF errcode==8 %]<div class="dialog alert">As owner of a list you cannot accept an invitation for sharing it.</div>[% END %]
+        <p><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Return to your lists</a></p>
 
     [% ELSIF op=='invite' %]
         <form method="post" onsubmit="return $('#invite_address').val().trim()!='';">
@@ -35,6 +36,7 @@
 
             <fieldset class="action">
                 <input type="submit" value="Send" />
+                <a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves" class="cancel">Cancel</a>
             </fieldset>
         </form>
 
index 9e12266..97fe8b2 100755 (executable)
@@ -283,8 +283,8 @@ sub stringtokey {
 
 sub alphabet_ordinal {
     my ($char, $alphabet) = @_;
-    for( 0..$#$alphabet ) {
-        return $_ if $char eq $alphabet->[$_];
+    for my $ord ( 0..$#$alphabet ) {
+        return $ord if $char eq $alphabet->[$ord];
     }
     return ''; #ignore missing chars
 }