Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: test/phpunit/CodingPhpTest.php
This commit is contained in:
commit
6e7e8d7d36
@ -1716,7 +1716,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
// Hour start
|
||||
if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour)
|
||||
{
|
||||
$daterange .= dol_print_date($event->date_start_in_calendar, 'hour'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user
|
||||
$daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuser');
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar)
|
||||
{
|
||||
if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend)
|
||||
@ -1736,7 +1736,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar)
|
||||
{
|
||||
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
|
||||
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user
|
||||
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuser');
|
||||
}
|
||||
} else {
|
||||
if ($showinfo)
|
||||
|
||||
@ -776,10 +776,10 @@ $( document ).ready(function() {
|
||||
{
|
||||
print "ModalBox('ModalTerminal');";
|
||||
}
|
||||
if ($conf->global->TAKEPOS_CONTROL_CASH_OPENING)
|
||||
$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
||||
$sql .= " entity = ".$conf->entity." AND ";
|
||||
$sql .= " date(date_creation) = CURDATE()";
|
||||
if ($conf->global->TAKEPOS_CONTROL_CASH_OPENING) {
|
||||
$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
||||
$sql .= " entity = ".$conf->entity." AND ";
|
||||
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
@ -1027,7 +1027,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
|
||||
|
||||
$sql = "SELECT rowid, status, entity FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
||||
$sql .= " entity = ".$conf->entity." AND ";
|
||||
$sql .= " date(date_creation) = CURDATE()";
|
||||
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@ -376,7 +376,18 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
||||
break;
|
||||
}
|
||||
$this->assertTrue($ok, 'Found a declaration @var array() instead of @var array in file '.$file['relativename'].'.');
|
||||
}
|
||||
|
||||
|
||||
// Test we don't have CURDATE()
|
||||
$ok=true;
|
||||
$matches=array();
|
||||
preg_match_all('/CURDATE\(\)/', $filecontent, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $key => $val) {
|
||||
$ok=false;
|
||||
break;
|
||||
}
|
||||
$this->assertTrue($ok, 'Found a CURDATE\(\) into code. Do not use this SQL method in file '.$file['relativename'].'. You must use the PHP function dol_now() instead.');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user