diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index ebf397c2dfd..af8d26bb374 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -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); diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 6bae9666ee9..a9726bd7baf 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -225,7 +225,7 @@ print ''.$langs->trans("CurrentTimeZone").''; / $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)).')'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 59d5a6b6691..95f2a3f3494 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -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); diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index cbfaa883da7..1e7f9b299c6 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -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') {