From 1aeb1d7e0b4c027b0277f5f5878a3b047abd4b82 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 14 Feb 2014 12:52:34 -0500 Subject: [PATCH] Bug 11765 - Remove unused function isDate from templates Several administration templates declare but do not use the JavaScript function isDate(). This patch removes the declarations. To test, apply the patch and search for instances of "isDate" in Koha templates, includes, and JavaScript files. There should be no results. Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart I'm not sure this function has ever been used. This patch removes the toUC in tools/letter.tt too. Signed-off-by: Galen Charlton --- .../prog/en/modules/admin/auth_tag_structure.tt | 7 ------- .../prog/en/modules/admin/categorie.tt | 7 ------- .../prog/en/modules/admin/itemtypes.tt | 7 ------- .../prog/en/modules/admin/printers.tt | 7 ------- .../prog/en/modules/admin/roadtype.tt | 7 ------- .../prog/en/modules/admin/systempreferences.tt | 7 ------- .../prog/en/modules/admin/z3950servers.tt | 7 ------- .../prog/en/modules/tools/letter.tt | 17 ++--------------- 8 files changed, 2 insertions(+), 64 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt index 7ecb5658fa..f8c3910aed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt @@ -39,13 +39,6 @@ return false; return true; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// - function isDate(f) { - var t = Date.parse(f.value); - if (isNaN(t)) { - return false; - } - } - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// function Check(f) { var ok=1; var _alertString=""; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt index 49b359a45a..b9e67400f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt @@ -45,13 +45,6 @@ } return true; } - // - function isDate(f) { - var t = Date.parse(f.value); - if (isNaN(t)) { - return false; - } - } // to check if the data are correctly entered. function Check(ff) { var ok=0; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index 2e25cdc9f9..0c1d36836c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -41,13 +41,6 @@ if (maybenull==0 && v.value=='') { return true; } -function isDate(f) { - var t = Date.parse(f.value); - if (isNaN(t)) { - return false; - } -} - function Check(f) { var ok=1; var _alertString=""; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt index 5206eabcdf..151e8d6ff8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt @@ -27,13 +27,6 @@ return true; } // - function isDate(f) { - var t = Date.parse(f.value); - if (isNaN(t)) { - return false; - } - } - // function Check(f) { var ok=1; var _alertString=""; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt index b542682be9..526b445aa3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt @@ -22,13 +22,6 @@ return true; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// - function isDate(f) { - var t = Date.parse(f.value); - if (isNaN(t)) { - return false; - } - } - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// function Check(f) { var ok=1; var _alertString=""; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt index 0adab30dd6..6ca3274a30 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt @@ -47,13 +47,6 @@ return true; } // - function isDate(f) { - var t = Date.parse(f.value); - if (isNaN(t)) { - return false; - } - } - // function Check(f) { var ok=1; var _alertString=""; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt index 1f5bbddfac..a1dc45f678 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -32,13 +32,6 @@ return true; } // - function isDate(f) { - var t = Date.parse(f.value); - if (isNaN(t)) { - return false; - } - } - // function Check(f) { var ok=1; var _alertString=""; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index 95c55e5e54..d4c864ba39 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -38,13 +38,7 @@ $(document).ready(function() { } 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)) { @@ -55,14 +49,7 @@ $(document).ready(function() { } return true; } - - function isDate(f) { - var t = Date.parse(f.value); - if (isNaN(t)) { - return false; - } - } - + function Check(f) { var ok=1; var _alertString=""; -- 2.39.5