Fix warnings

This commit is contained in:
Laurent Destailleur 2020-11-21 16:49:54 +01:00
parent 95b79094df
commit bf94ce6aad
4 changed files with 16 additions and 17 deletions

View File

@ -460,7 +460,7 @@ class AccountingAccount extends CommonObject
$result = '';
$url = '';
$url = ''; $labelurl = '';
if (empty($option) || $option == 'ledger') {
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
$labelurl = $langs->trans("ShowAccountingAccountInLedger");
@ -617,16 +617,13 @@ class AccountingAccount extends CommonObject
// phpcs:enable
$this->db->begin();
if ($mode == 0)
{
$fieldtouse = 'active';
} elseif ($mode == 1)
{
$fieldtouse = 'active';
if ($mode == 1) {
$fieldtouse = 'reconcilable';
}
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account ";
$sql .= "SET ".$fieldtouse." = '1'";
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account";
$sql .= " SET ".$fieldtouse." = '1'";
$sql .= " WHERE rowid = ".$this->db->escape($id);
dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG);

View File

@ -225,7 +225,7 @@ print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; /
$a = getServerTimeZoneInt('now');
$b = getServerTimeZoneInt('winter');
$c = getServerTimeZoneInt('summer');
$daylight = (is_numeric($c) && is_numeric($b)) ?round($c - $b) : 'unknown';
$daylight = round($c - $b);
//print $a." ".$b." ".$c." ".$daylight;
$val = ($a >= 0 ? '+' : '').$a;
$val .= ' ('.($a == 'unknown' ? 'unknown' : ($a >= 0 ? '+' : '').($a * 3600)).')';

View File

@ -1206,16 +1206,17 @@ class ActionComm extends CommonObject
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @param int $load_state_board Load indicator array this->nb
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $load_state_board = 0)
{
// phpcs:enable
global $conf, $langs;
if (empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp";
else {
if (empty($load_state_board)) {
$sql = "SELECT a.id, a.datep as dp";
} else {
$this->nb = array();
$sql = "SELECT count(a.id) as nb";
}
@ -1243,13 +1244,14 @@ class ActionComm extends CommonObject
$response->img = img_object('', "action", 'class="inline-block valigntextmiddle"');
}
// This assignment in condition is not a bug. It allows walking the results.
while ($obj = $this->db->fetch_object($resql))
{
while ($obj = $this->db->fetch_object($resql)) {
if (empty($load_state_board)) {
$response->nbtodo++;
$agenda_static->datep = $this->db->jdate($obj->dp);
if ($agenda_static->hasDelay()) $response->nbtodolate++;
} else $this->nb["actionscomm"] = $obj->nb;
} else {
$this->nb["actionscomm"] = $obj->nb;
}
}
$this->db->free($resql);

View File

@ -78,7 +78,7 @@ function getServerTimeZoneString()
* Return server timezone int.
*
* @param string $refgmtdate Reference period for timezone (timezone differs on winter and summer. May be 'now', 'winter' or 'summer')
* @return int An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer)
* @return float An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer). Note some countries use half and even quarter hours.
*/
function getServerTimeZoneInt($refgmtdate = 'now')
{