2
0
forked from Wavyzz/dolibarr

Fix: Corrige pb date calendrier non clicable si cal ouvert par doubleclic

This commit is contained in:
Laurent Destailleur
2007-12-21 17:18:32 +00:00
parent 21fe55afee
commit b312f7f79d
3 changed files with 31 additions and 22 deletions

View File

@@ -44,7 +44,12 @@ if (isset($_GET["mode"]) && $_GET["mode"] == 'test')
{ {
print '<html><head>'; print '<html><head>';
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_head.js"></script>'."\n"; print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_head.js"></script>'."\n";
print '</head>'; print '</head><body>'."\n";
}
else
{
//print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'."\n";
print '<html><head></head><body>'."\n";
} }
@@ -76,6 +81,9 @@ else
} }
print '</body></html>'."\n";
function xyzToUnixTimestamp($mysqldate){ function xyzToUnixTimestamp($mysqldate){
$year=substr($mysqldate,0,4); $year=substr($mysqldate,0,4);
$month=substr($mysqldate,4,2); $month=substr($mysqldate,4,2);
@@ -103,9 +111,9 @@ function displayBox($selectedDate,$month,$year){
$xyz=0; $xyz=0;
} }
?> ?>
<table class="dp" cellspacing="0" cellpadding="0" border=0> <table class="dp" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td colspan=6 class="dpHead"> <td colspan="6" class="dpHead">
<?php <?php
$selectMonth = dolibarr_date("F", $thedate); $selectMonth = dolibarr_date("F", $thedate);
$selectYear = dolibarr_date("Y", $thedate); $selectYear = dolibarr_date("Y", $thedate);
@@ -117,7 +125,7 @@ function displayBox($selectedDate,$month,$year){
<tr> <tr>
<td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo $month?>','<?php echo $year-1?>','<?php echo $xyz ?>')">&lt;&lt;</td> <td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo $month?>','<?php echo $year-1?>','<?php echo $xyz ?>')">&lt;&lt;</td>
<td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php if($month==1) echo "12"; else echo $month-1?>','<?php if($month==1) echo $year-1; else echo $year?>','<?php echo $xyz ?>')">&lt;</td> <td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php if($month==1) echo "12"; else echo $month-1?>','<?php if($month==1) echo $year-1; else echo $year?>','<?php echo $xyz ?>')">&lt;</td>
<td colspan=3 class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo dolibarr_date('m',$today)?>','<?php echo $todayArray["year"]?>','<?php echo $xyz ?>')"><?php echo $langs->trans("Today") ?></td> <td colspan="3" class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo dolibarr_date('m',$today)?>','<?php echo $todayArray["year"]?>','<?php echo $xyz ?>')"><?php echo $langs->trans("Today") ?></td>
<td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php if($month==12) echo "1"; else echo $month+1?>','<?php if($month==12) echo $year+1; else echo $year;?>','<?php echo $xyz ?>')">&gt;</td> <td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php if($month==12) echo "1"; else echo $month+1?>','<?php if($month==12) echo $year+1; else echo $year;?>','<?php echo $xyz ?>')">&gt;</td>
<td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo $month?>','<?php echo $year+1?>','<?php echo $xyz ?>')">&gt;&gt;</td> <td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo $month?>','<?php echo $year+1?>','<?php echo $xyz ?>')">&gt;&gt;</td>
</tr> </tr>
@@ -134,23 +142,6 @@ function displayBox($selectedDate,$month,$year){
//print "x ".$thedate." y"; //print "x ".$thedate." y";
$firstdate=dolibarr_getdate($thedate); $firstdate=dolibarr_getdate($thedate);
$mydate=$firstdate; $mydate=$firstdate;
$tradTemp=Array($langs->trans("January"),
$langs->trans("February"),
$langs->trans("March"),
$langs->trans("April"),
$langs->trans("May"),
$langs->trans("June"),
$langs->trans("July"),
$langs->trans("August"),
$langs->trans("September"),
$langs->trans("October"),
$langs->trans("November"),
$langs->trans("December")
);
print '<script language="Javascript">';
print 'var tradMonths = '.php2js($tradTemp);
print '</script>';
// Loop on each day of month // Loop on each day of month
$day=1; $day=1;

View File

@@ -146,7 +146,8 @@ function loadMonth(base,month,year,ymd)
theURL+="&sd="+ymd; theURL+="&sd="+ymd;
} }
loadXMLDoc(theURL,alertContents,false); // loadXMLDoc(theURL,alertContents,false); Cree erreur javascript avec IE
loadXMLDoc(theURL,null,false);
showDP.box.innerHTML=req.responseText; showDP.box.innerHTML=req.responseText;
} }

View File

@@ -757,6 +757,23 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0)
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/includes/scriptaculous/src/window/tooltip.js"></script>'."\n"; print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/includes/scriptaculous/src/window/tooltip.js"></script>'."\n";
} }
// Define tradMonths javascript array
$tradTemp=Array($langs->trans("January"),
$langs->trans("February"),
$langs->trans("March"),
$langs->trans("April"),
$langs->trans("May"),
$langs->trans("June"),
$langs->trans("July"),
$langs->trans("August"),
$langs->trans("September"),
$langs->trans("October"),
$langs->trans("November"),
$langs->trans("December")
);
print '<script language="javascript" type="text/javascript">';
print 'var tradMonths = '.php2js($tradTemp).';';
print '</script>'."\n";
print "</head>\n"; print "</head>\n";
} }