Fix: avoid errors with IE
This commit is contained in:
parent
9d95e8bffb
commit
89b794dcd0
@ -228,16 +228,16 @@ print '<td align="center" valign="top">';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||
$filter='s.client in (1,2,3)';
|
||||
print $form->select_company($socid,'socid',$filter,1);
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td>'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td>';
|
||||
print '<tr><td align="left">'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td align="left">';
|
||||
print $form->select_users($userid,'userid',1);
|
||||
print '</td></tr>';
|
||||
// Year
|
||||
print '<tr><td>'.$langs->trans("Year").'</td><td>';
|
||||
print '<tr><td align="left">'.$langs->trans("Year").'</td><td align="left">';
|
||||
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
|
||||
arsort($arrayyears);
|
||||
print $form->selectarray('year',$arrayyears,$year,0);
|
||||
|
||||
@ -249,17 +249,17 @@ print '<td align="center" valign="top">';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||
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 '</td></tr>';
|
||||
// User
|
||||
print '<tr><td>'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td>';
|
||||
print '<tr><td align="left">'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td align="left">';
|
||||
print $form->select_users($userid,'userid',1);
|
||||
print '</td></tr>';
|
||||
// Year
|
||||
print '<tr><td>'.$langs->trans("Year").'</td><td>';
|
||||
print '<tr><td align="left">'.$langs->trans("Year").'</td><td align="left">';
|
||||
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
|
||||
arsort($arrayyears);
|
||||
print $form->selectarray('year',$arrayyears,$year,0);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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]();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user