Bug 11764 - Move repeatedly redefined function toUC() into staff-global.js
authorOwen Leonard <oleonard@myacpl.org>
Fri, 14 Feb 2014 17:22:19 +0000 (12:22 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 18 Feb 2014 20:49:30 +0000 (20:49 +0000)
toUC() is repeatedly declared on many administration templates. This
function, used to transform user input to uppercase, can be added to
staff-global.js to prevent repetition.

To test, confirm that transformation to uppercase is working on the
following Administration pages when text is entered in a form field and
focus is moved to the next field:

- Authority types -> New: Test the "Authority type" field.
- MARC bibliographic framework -> New framework: Test the "Framework
  code" field.
- Patron types and categories -> New category: Test the "Category code"
  field.
- Currencies and exchange rates -> New currency: Test the "Currency"
  field.
- Item types -> New item type: Test the "Item type" field.
- Z39.50 client targets -> New Z39.50 server: Test the "Z39.50 server"
  field.

The following pages do not call the toUC function despite the fact that
they included it:

auth_tag_structure.tt
printers.tt
roadtype.tt
stopwords.tt
systempreferences.tt

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
tools/letter.tt declares this js function and don't use it.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
12 files changed:
koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js
koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/stopwords.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt

index 234a871..c97007f 100644 (file)
@@ -86,3 +86,9 @@ function openWindow(link,name,width,height) {
 function removeFocus() {
     $(':focus').blur();
 }
+
+function toUC(f) {
+    var x=f.value.toUpperCase();
+    f.value=x;
+    return true;
+}
\ No newline at end of file
index aed41b6..7ecb565 100644 (file)
@@ -28,12 +28,6 @@ return false;
         return true;
     }
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    function toUC(f) {
-        var x=f.value.toUpperCase();
-        f.value=x;
-        return true;
-    }
-    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     function isNum(v,maybenull) {
     var n = new Number(v.value);
     if (isNaN(n)) {
index dab813e..7823108 100644 (file)
@@ -17,12 +17,6 @@ function isNotNull(f,noalert) {
        return true;
 }
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-function toUC(f) {
-       var x=f.value.toUpperCase();
-       f.value=x;
-       return true;
-}
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 function Check(f) {
        var _alertString="";
        var alertString2;
index e6ce9d8..ec458b3 100644 (file)
@@ -16,10 +16,6 @@ function isNotNull(f,noalert) {
     }
     return true;
 }
-function toUC(f) {
-    f.value = f.value.toUpperCase();
-    return true;
-}
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 function Check(f) {
     var ok=1;
index ce7f014..49b359a 100644 (file)
                return true;
        }
        //
-       function toUC(f) {
-               var x=f.value.toUpperCase();
-               f.value=x;
-               return true;
-       }
-       //
        function isNum(v,maybenull) {
        var n = new Number(v.value);
        if (isNaN(n)) {
index 99f693b..def9a02 100644 (file)
@@ -7,11 +7,6 @@
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript">
 //<![CDATA[
-    function toUC(f) {
-        var x=f.value.toUpperCase();
-        f.value=x;
-        return true;
-    }
     function Check(f) {
         var _alertString="";
         var alertString2;
index 57847eb..2e25cdc 100644 (file)
@@ -30,12 +30,6 @@ function isNotNull(f,noalert) {
        return true;
 }
 
-function toUC(f) {
-       var x=f.value.toUpperCase();
-       f.value=x;
-       return true;
-}
-
 function isNum(v,maybenull) {
 var n = new Number(v.value);
 if (isNaN(n)) {
index 6edc88f..5206eab 100644 (file)
                 return true;
         }
         //
-        function toUC(f) {
-                var x=f.value.toUpperCase();
-                f.value=x;
-                return true;
-        }
-        //
         function isNum(v,maybenull) {
         var n = new Number(v.value);
         if (isNaN(n)) {
index ad491fd..b542682 100644 (file)
         return true;
         }
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-        function toUC(f) {
-                var x=f.value.toUpperCase();
-                f.value=x;
-                return true;
-        }
-        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         function isNum(v,maybenull) {
         var n = new Number(v.value);
         if (isNaN(n)) {
index 5b53dc0..6ba5697 100644 (file)
     $(document).ready(function() {
         new YAHOO.widget.Button("newstopword");
     });
-    function toUC(f) {
-        var x=f.value.toUpperCase();
-        f.value=x;
-        return true;
-    }
     function Check(f) {
         if (f.word.value.length==0) {
             alert(_("Form not submitted: word missing"));
index e903038..0adab30 100644 (file)
             return true;
         }
         //
-        function toUC(f) {
-            var x=f.value.toUpperCase();
-            f.value=x;
-            return true;
-        }
-        //
         function isNum(v,maybenull) {
         var n = new Number(v.value);
         if (isNaN(n)) {
index 915e531..1f5bbdd 100644 (file)
                 return true;
         }
         //
-        function toUC(f) {
-                var x=f.value.toUpperCase();
-                f.value=x;
-                return true;
-        }
-        //
         function isNum(v,maybenull) {
         var n = new Number(v.value);
         if (isNaN(n)) {