From 89b794dcd09e80814b25746986a9ac77f4dacef8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 25 Oct 2012 14:57:56 +0200 Subject: [PATCH] Fix: avoid errors with IE --- htdocs/comm/propal/stats/index.php | 6 +++--- htdocs/commande/stats/index.php | 6 +++--- htdocs/core/js/dst.js | 9 +++++++-- htdocs/core/js/lib_head.js | 11 ++++++----- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 1f0d9be22e6..1badb9e8c1e 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -228,16 +228,16 @@ print ''; print ''; print ''; // Company - print ''; // User - print ''; // Year - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; + print '
'.$langs->trans("ThirdParty").''; $filter='s.client in (1,2,3)'; print $form->select_company($socid,'socid',$filter,1); print '
'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").''; + print '
'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").''; print $form->select_users($userid,'userid',1); print '
'.$langs->trans("Year").''; + print '
'.$langs->trans("Year").''; if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year; arsort($arrayyears); print $form->selectarray('year',$arrayyears,$year,0); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index fd97ae70f4a..2d6c906fded 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -249,17 +249,17 @@ print ''; print ''; print ''; // Company - print ''; // User - print ''; // Year - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; + print '
'.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; print $form->select_company($socid,'socid',$filter,1); print '
'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").''; + print '
'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").''; print $form->select_users($userid,'userid',1); print '
'.$langs->trans("Year").''; + print '
'.$langs->trans("Year").''; if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year; arsort($arrayyears); print $form->selectarray('year',$arrayyears,$year,0); diff --git a/htdocs/core/js/dst.js b/htdocs/core/js/dst.js index da74cc3b857..250d379ed42 100644 --- a/htdocs/core/js/dst.js +++ b/htdocs/core/js/dst.js @@ -38,12 +38,17 @@ $(document).ready(function () { } else { dst = "1"; // daylight savings time is observed } - var tz=new Date().toTimeString().match(/\(.*\)/); + var now=new Date(); + var tz=now.toTimeString().match(/\(.*\)/); + //alert('date=' + now + ' string=' + now.toTimeString()); var dst_first=DisplayDstSwitchDates('first'); var dst_second=DisplayDstSwitchDates('second'); //alert(dst); $('#tz').val(std_time_offset); // returns TZ - $('#tz_string').val(tz[0].replace('(','').replace(')','')); // returns TZ string + // tz is null with IE + if (tz != null) { + $('#tz_string').val(tz[0].replace('(','').replace(')','')); // returns TZ string + } $('#dst_observed').val(dst); // returns if DST is observed on summer $('#dst_first').val(dst_first); // returns DST first switch in year $('#dst_second').val(dst_second); // returns DST second switch in year diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index 2f9de0c6e27..62427857749 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -718,9 +718,10 @@ function delConstant(url, code, input, entity) { * */ function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton) { + var boxConfirm = box; $("#confirm_" + code) - .attr("title", box.title) - .html(box.content) + .attr("title", boxConfirm.title) + .html(boxConfirm.content) .dialog({ resizable: false, height: 170, @@ -737,9 +738,9 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, } // Close dialog $(this).dialog("close"); - // Execute another function - if (box.function) { - var fnName = box.function; + // Execute another method + if (boxConfirm.method) { + var fnName = boxConfirm.method; if (window.hasOwnProperty(fnName)) { window[fnName](); }