From 9d058b136ddfc8207988145a96b54808e6ae4b3e Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 25 May 2015 11:32:51 +0200 Subject: [PATCH] Bug 14267: How active is active? git grep on function active in additem.tt: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt:function active(n koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt:active([% koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt:function a koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt: t/Cache.t: unless ( $cache->is_cache_active() && defined $cache ); t/Cache.t: unless ( $cache->is_cache_active() ); Conclusion: active in additem seems to be quite inactive. Test plan: Add, edit or delete items and verify that you did not miss active :) NOTE: The active function has a loop which is always run. Inside that loop 'ong' would always be defined as some number concatenated with XX. Both sides of the if/else reference document.getElementById(ong), but there is only one occurence of XX in the file: the concatenation! Similarly, the 'link' logic does not correspond to any of the id= or name= strings in the file. koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt is the only file with "id=\"link" that matches the logic. This is likely a cut-and-paste remnant made useless by datatable upgrades and HTML/CSS class changes. Signed-off-by: Mark Tompsett Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 9cdc1cf..6c07b61 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -43,22 +43,6 @@ $(document).ready(function(){ } ) ); }); -function active(numlayer) -{ - for (i=10; i < 11 ; i++ ) { - ong = i+"XX"; - link = "link"+i; - if (numlayer==i) { - document.getElementById(ong).style.visibility="visible"; - document.getElementById(link).style.backgroundColor="#11AA11"; - document.getElementById(link).style.backgroundImage="url([% themelang %]/images/background-mem.gif)"; - } else { - document.getElementById(ong).style.visibility="hidden"; - document.getElementById(link).style.backgroundColor="#FFFFFF"; - document.getElementById(link).style.backgroundImage=""; - } - } -} function Check(f) { var total_errors = CheckMandatorySubfields(f); if (total_errors==0) { -- 2.1.0