Fix pb into date management.

Added phpunit to avoid this in future.
This commit is contained in:
Laurent Destailleur 2015-02-03 12:21:30 +01:00
parent 20121c2fbe
commit fe674f8fd5

View File

@ -26,13 +26,13 @@
* \brief File to manage popup date selector * \brief File to manage popup date selector
*/ */
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // disabled
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load global conf for START_WEEK
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language if (! defined('NOLOGIN')) define('NOLOGIN',1); // disabled
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
@ -188,26 +188,12 @@ function displayBox($selectedDate,$month,$year)
<tr class="dpDayNames"> <tr class="dpDayNames">
<?php <?php
$startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1; $startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1;
if($startday==1) $day_names = array('ShortSunday', 'ShortMonday', 'ShortTuesday', 'ShortWednesday', 'ShortThursday', 'ShortFriday', 'ShortSaturday');
{?> for( $i=0; $i < 7; $i++ )
<td width="14%"><?php echo $langs->trans("ShortMonday") ?></td> {
<td width="15%"><?php echo $langs->trans("ShortTuesday") ?></td> echo '<td width="', (int) (($i+1)*100/7) - (int) ($i*100/7), '%">', $langs->trans($day_names[($i + $startday) % 7]), '</td>', "\n";
<td width="14%"><?php echo $langs->trans("ShortWednesday") ?></td> }
<td width="15%"><?php echo $langs->trans("ShortThursday") ?></td> ?>
<td width="14%"><?php echo $langs->trans("ShortFriday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortSaturday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortSunday") ?></td>
<?php
}else {?>
<td width="14%"><?php echo $langs->trans("ShortSunday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortMonday") ?></td>
<td width="15%"><?php echo $langs->trans("ShortTuesday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortWednesday") ?></td>
<td width="15%"><?php echo $langs->trans("ShortThursday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortFriday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortSaturday") ?></td>
<?php
}?>
</tr> </tr>
<?php <?php
//print "x ".$thedate." y"; // $thedate = first day of month //print "x ".$thedate." y"; // $thedate = first day of month