Bug 10439: fix bug preventing the library for a notice from being changed
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 10 Jun 2013 12:05:32 +0000 (14:05 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 17 Jun 2013 01:58:38 +0000 (18:58 -0700)
2 javascript functions should be apply only in a specific case, not for all
views.

Test plan:

- Switch on the IndependentBranches pref and log
  in as a superlibrarian.
- Try to change the library for a notice. Before the patch,
  no change is applied.
- Try to create a new notice, changing the library from
  default in the process.  Before the patch, the notice
  is not created.

The bug can also be reproduced when IndependentBranches is
off, in which case the staff user need not be a superlibrarian.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt

index f210715..52e2b83 100644 (file)
@@ -15,14 +15,16 @@ $(document).ready(function() {
         ],
         "bPaginate": false
     }));
-    $('#branch').change(function() {
+    [% IF no_op_set %]
+      $('#branch').change(function() {
             $('#op').val("");
             $('#selectlibrary').submit();
-    });
-    $('#newnotice').click(function() {
+      });
+      $('#newnotice').click(function() {
             $('#op').val("add_form");
             return true;
-    });
+      });
+    [% END %]
 }); 
 [% IF ( add_form ) %]