Bug 7323 - Javascript error when editing list
authorOwen Leonard <oleonard@myacpl.org>
Tue, 6 Dec 2011 16:43:10 +0000 (11:43 -0500)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 2 Jan 2012 22:46:13 +0000 (23:46 +0100)
Correcting check for empty shelf name to prevent
javascript error.

Also correcting unescaped ampersand.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt

index 12a0665..b432020 100644 (file)
@@ -95,7 +95,7 @@ function placeHold () {
                var _alertString="";
                var alertString2;
 
-           if(f.addshelf.value.length ==0){
+           if($("#shelfname").val() == ""){
                        _alertString += _("- You must enter a List Name") + "\n";
                }
 
@@ -349,7 +349,7 @@ function placeHold () {
                        <tr><th>List Name</th><th>Contents</th><th>Sort by</th><th>Type</th><th>Options</th></tr>
                 [% FOREACH shelveslooppri IN shelveslooppriv %]
                     [% IF ( shelveslooppri.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
-        <td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&amp;[% END %]viewshelf=[% shelveslooppri.shelf %]&shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
+        <td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&amp;[% END %]viewshelf=[% shelveslooppri.shelf %]&amp;shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
         <td>[% shelveslooppri.count %] item(s)</td>
         <td>[% IF ( shelveslooppri.authorsort ) %]Author[% ELSIF ( shelveslooppri.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
         <td>[% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]