diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php index 1f2b8d634d9..2c788b66b71 100644 --- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php +++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php @@ -71,13 +71,11 @@ class box_accountancy_last_manual_entries extends ModeleBoxes */ public function loadBox($max = 5) { - global $user, $langs, $db, $conf; - - $this->max = $max; + global $user, $langs, $conf; include_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; - $bookkeepingstatic = new BookKeeping($db); + $bookkeepingstatic = new BookKeeping($this->db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastManualEntries", $max)); @@ -92,17 +90,17 @@ class box_accountancy_last_manual_entries extends ModeleBoxes $sql.= " WHERE b.fk_doc = 0"; $sql.= " AND b.entity = ".$conf->entity; $sql.= " ORDER BY b.piece_num DESC "; - $sql.= $db->plimit($max, 0); + $sql.= $this->db->plimit($max, 0); - $result = $db->query($sql); + $result = $this->db->query($sql); if ($result) { - $num = $db->num_rows($result); + $num = $this->db->num_rows($result); $line = 0; while ($line < $num) { - $objp = $db->fetch_object($result); - $date = $db->jdate($objp->date_movement); + $objp = $this->db->fetch_object($result); + $date = $this->db->jdate($objp->date_movement); $journal = $objp->code_journal; $label = $objp->label_operation; $amount = $objp->montant; @@ -144,12 +142,12 @@ class box_accountancy_last_manual_entries extends ModeleBoxes if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedManualEntries")); - $db->free($result); + $this->db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => '', 'maxlength'=>500, - 'text' => ($db->error().' sql='.$sql), + 'text' => ($this->db->error().' sql='.$sql), ); } } else { diff --git a/htdocs/core/boxes/box_accountancy_suspense_account.php b/htdocs/core/boxes/box_accountancy_suspense_account.php index dd2d9a17695..9740de82fbc 100644 --- a/htdocs/core/boxes/box_accountancy_suspense_account.php +++ b/htdocs/core/boxes/box_accountancy_suspense_account.php @@ -37,7 +37,7 @@ class box_accountancy_suspense_account extends ModeleBoxes public $boxlabel="BoxSuspenseAccount"; public $depends = array("accounting"); - /** + /** * @var DoliDB Database handler. */ public $db; @@ -70,11 +70,11 @@ class box_accountancy_suspense_account extends ModeleBoxes */ public function loadBox() { - global $user, $langs, $db, $conf; + global $user, $langs, $conf; include_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; - $bookkeepingstatic = new BookKeeping($db); + $bookkeepingstatic = new BookKeeping($this->db); $this->info_box_head = array('text' => $langs->trans("BoxTitleSuspenseAccount")); @@ -88,10 +88,11 @@ class box_accountancy_suspense_account extends ModeleBoxes $sql .= " WHERE b.numero_compte = ". $suspenseAccount; $sql .= " AND b.entity = " . $conf->entity; - $result = $db->query($sql); + $result = $this->db->query($sql); + $nbSuspenseAccount = 0; if ($result) { - $obj=$db->fetch_object($result); + $obj=$this->db->fetch_object($result); $nbSuspenseAccount = $obj->nb_suspense_account; } diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 16dbec8313c..88582c487e4 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -85,7 +85,7 @@ class modSyslog extends DolibarrModules // Cronjobs $comment = 'Compress and archive log files. The number of versions to keep is defined into the setup of module. '; - $comment.= 'Warning: Main application cron script must be run with same account than your web server to avoid to get log files with different owner than required by web server.'; + $comment.= 'Warning: Main application cron script must be run with same account than your web server to avoid to get log files with different owner than required by web server. '; $comment.= 'Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission "rws" on this directory so log files will always have the group and permissions of the web server Operating System group.'; $this->cronjobs = array(