diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 1a682636077..c8cb62cd7e0 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -395,8 +395,8 @@ $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 $page = 0; $offset = 0; @@ -406,9 +406,9 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $sql .= $db->plimit($limit + 1, $offset); dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG); -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); $i = 0; $param = ''; @@ -608,7 +608,7 @@ if ($result) { $i = 0; while ($i < min($num, $limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); // Ref produit as link $product_static->ref = $obj->ref; @@ -891,7 +891,7 @@ if ($result) { print ''; - $db->free($result); + $db->free($resql); } else { dol_print_error($db); } diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index ac943180b58..72efffc2b49 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -586,11 +586,11 @@ class AccountingAccount extends CommonObject $sql .= ' WHERE a.rowid = ' . ((int) $id); dol_syslog(get_class($this) . '::info sql=' . $sql); - $result = $this->db->query($sql); + $resql = $this->db->query($sql); - if ($result) { - if ($this->db->num_rows($result)) { - $obj = $this->db->fetch_object($result); + if ($resql) { + if ($this->db->num_rows($resql)) { + $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; if ($obj->fk_user_author) { $cuser = new User($this->db); @@ -605,7 +605,7 @@ class AccountingAccount extends CommonObject $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->tms); } - $this->db->free($result); + $this->db->free($resql); } else { dol_print_error($this->db); } diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index a2718973185..81caaa05358 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -266,14 +266,14 @@ class Lettering extends BookKeeping $sql .= " ORDER BY ab2.lettering_code DESC"; $sql .= " LIMIT 1 "; - $result = $this->db->query($sql); - if ($result) { - $obj = $this->db->fetch_object($result); + $resqla = $this->db->query($sql); + if ($resqla) { + $obj = $this->db->fetch_object($resqla); $lettre = (empty($obj->lettering_code) ? 'AAA' : $obj->lettering_code); if (!empty($obj->lettering_code)) { $lettre++; } - $this->db->free($result); + $this->db->free($resqla); } else { $this->errors[] = 'Error'.$this->db->lasterror(); $error++; @@ -281,14 +281,14 @@ class Lettering extends BookKeeping $sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE "; $sql .= " rowid IN (".$this->db->sanitize(implode(',', $ids)).") AND lettering_code IS NULL AND subledger_account != ''"; - $result = $this->db->query($sql); - if ($result) { - $obj = $this->db->fetch_object($result); + $resqlb = $this->db->query($sql); + if ($resqlb) { + $obj = $this->db->fetch_object($resqlb); if (!(round(abs($obj->deb), 2) === round(abs($obj->cred), 2))) { $this->errors[] = 'Total not exacts '.round(abs($obj->deb), 2).' vs '.round(abs($obj->cred), 2); $error++; } - $this->db->free($result); + $this->db->free($resqlb); } else { $this->errors[] = 'Erreur sql'.$this->db->lasterror(); $error++; diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 9aef78174de..b3cfe027197 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -490,17 +490,17 @@ class Subscription extends CommonObject $sql .= ' FROM '.MAIN_DB_PREFIX.'subscription as c'; $sql .= ' WHERE c.rowid = '.((int) $id); - $result = $this->db->query($sql); - if ($result) { - if ($this->db->num_rows($result)) { - $obj = $this->db->fetch_object($result); + $resql = $this->db->query($sql); + if ($resql) { + if ($this->db->num_rows($resql)) { + $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); } - $this->db->free($result); + $this->db->free($resql); } else { dol_print_error($this->db); } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 2b0c295afbd..1ef98dddb6d 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -99,12 +99,12 @@ $sql .= " WHERE t.entity IN (".getEntity('member_type').")"; $sql .= " GROUP BY t.rowid, t.libelle, t.subscription, d.statut"; dol_syslog("index.php::select nb of members per type", LOG_DEBUG); -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); $i = 0; while ($i < $num) { - $objp = $db->fetch_object($result); + $objp = $db->fetch_object($resql); $adhtype = new AdherentType($db); $adhtype->id = $objp->rowid; @@ -127,7 +127,7 @@ if ($result) { $i++; } - $db->free($result); + $db->free($resql); } $now = dol_now(); @@ -143,16 +143,16 @@ $sql .= " AND t.rowid = d.fk_adherent_type"; $sql .= " GROUP BY d.fk_adherent_type"; dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG); -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); $i = 0; while ($i < $num) { - $objp = $db->fetch_object($result); + $objp = $db->fetch_object($resql); $MembersUpToDate[$objp->fk_adherent_type] = $objp->somme; $i++; } - $db->free(); + $db->free($resql); } /* diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 316254b0398..583626f0220 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -310,9 +310,9 @@ if ($object->id > 0) { $sql .= " AND pfd.ext_payment_id IS NULL"; $sql .= " ORDER BY pfd.date_demande DESC"; - $result_sql = $db->query($sql); - if ($result_sql) { - $num = $db->num_rows($result_sql); + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); $numopen = $num; } else { dol_print_error($db); @@ -695,9 +695,9 @@ if ($object->id > 0) { $sql .= " AND pfd.traite = 0"; $sql .= " AND pfd.ext_payment_id IS NULL"; - $result_sql = $db->query($sql); - if ($result_sql) { - $obj = $db->fetch_object($result_sql); + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); if ($obj) { $pending = $obj->amount; } @@ -797,17 +797,17 @@ if ($object->id > 0) { $sql .= " AND pfd.ext_payment_id IS NULL"; $sql .= " ORDER BY pfd.date_demande DESC"; - $result_sql = $db->query($sql); + $resql = $db->query($sql); $num = 0; - if ($result_sql) { + if ($resql) { $i = 0; $tmpuser = new User($db); $num = $db->num_rows($result); while ($i < $num) { - $obj = $db->fetch_object($result_sql); + $obj = $db->fetch_object($resql); $tmpuser->id = $obj->user_id; $tmpuser->login = $obj->login; @@ -840,7 +840,7 @@ if ($object->id > 0) { $i++; } - $db->free($result_sql); + $db->free($resql); } else { dol_print_error($db); } diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 7cd49a9427c..640ffc78d99 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -198,7 +198,7 @@ if ($action == 'create') { if ($resql) { $obj = $db->fetch_object($resql); $sumpaid = $obj->total; - $db->free(); + $db->free($resql); } /*print ''.$langs->trans("AlreadyPaid").''.price($sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).''; print ''.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'';*/ diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index 28bc838c296..84d2765b278 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -194,7 +194,7 @@ if ($action == 'create') { if ($resql) { $obj = $db->fetch_object($resql); $sumpaid = $obj->total; - $db->free(); + $db->free($resql); } /*print ''.$langs->trans("AlreadyPaid").''.price($sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).''; print ''.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'';*/ diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 9c30db6e08a..8ee4c854600 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -143,7 +143,8 @@ if ($resql) { print price($total); print ' '; print ""; - $db->free(); + + $db->free($resql); } else { dol_print_error($db); } diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 99739260b36..db0f515273c 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -346,22 +346,27 @@ if ($result) { while ($i < $num) { $obj = $db->fetch_object($result); + $datem = $db->jdate($obj->tms); + + $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid); + $staticcontrat->id = $obj->cid; + + $staticcompany->id = $obj->socid; + $staticcompany->name = $obj->name; print ''; print ''; - $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid); - $staticcontrat->id = $obj->cid; print $staticcontrat->getNomUrl(1, 16); if ($obj->nb_late) { print img_warning($langs->trans("Late")); } print ''; print ''; - $staticcompany->id = $obj->socid; - $staticcompany->name = $obj->name; print $staticcompany->getNomUrl(1, '', 20); print ''; - print ''.dol_print_date($db->jdate($obj->tms), 'dayhour').''; + print ''; + print dol_print_date($datem, 'dayhour'); + print ''; //print ''.$staticcontrat->LibStatut($obj->statut,2).''; print ''.($obj->nb_initial > 0 ? ''.$obj->nb_initial.''.$staticcontratligne->LibStatut(0, 3, -1, 'class="paddingleft"') : '').''; print ''.($obj->nb_running > 0 ? ''.$obj->nb_running.''.$staticcontratligne->LibStatut(4, 3, 0, 'class="marginleft"') : '').''; @@ -451,7 +456,7 @@ if ($resql) { print "\n"; $i++; } - $db->free(); + $db->free($resql); print ""; } else { @@ -532,7 +537,8 @@ if ($resql) { print "\n"; $i++; } - $db->free(); + + $db->free($resql); print ""; } else { @@ -614,7 +620,7 @@ if ($resql) { print "\n"; $i++; } - $db->free(); + $db->free($resql); print ""; } else { diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index d96fac8bc76..a9a4f8746da 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -147,7 +147,7 @@ class box_boms extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 2afa630860b..4a7ea965006 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -140,7 +140,7 @@ class box_clients extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, "day", 'tzuserrel') ); diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index b2ba608d689..ea35a080d0e 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -177,7 +177,7 @@ class box_contacts extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 8eeb1b93323..dddafffdc02 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -83,8 +83,8 @@ class box_contracts extends ModeleBoxes $thirdpartytmp = new Societe($this->db); $sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; - $sql .= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture"; - $sql .= ", c.ref_customer, c.ref_supplier"; + $sql .= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.tms as date_modification, c.fin_validite, c.date_cloture,"; + $sql .= " c.ref_customer, c.ref_supplier"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -117,6 +117,7 @@ class box_contracts extends ModeleBoxes $objp = $this->db->fetch_object($resql); $datec = $this->db->jdate($objp->datec); + $datem = $this->db->jdate($objp->date_modification); $dateterm = $this->db->jdate($objp->fin_validite); $dateclose = $this->db->jdate($objp->date_cloture); $late = ''; @@ -155,8 +156,8 @@ class box_contracts extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datec, 'day', 'tzuserrel'), + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 5865cba2530..e091d58643b 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -145,7 +145,7 @@ class box_members extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 6436fb8e34e..cff19388c17 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -144,7 +144,7 @@ class box_mos extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index f3f9496325f..97b7bd5fd51 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -165,7 +165,7 @@ class box_propales extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="center nowraponall"', + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("Date").': '.dol_print_date($datem, 'day', 'tzuserrel')).'"', 'text' => dol_print_date($date, 'day', 'tzuserrel'), ); diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 5128509c88c..6cc37303346 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -149,7 +149,7 @@ $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); $sumpaid = $obj->total; - $db->free(); + $db->free($resql); } diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index ee80c9bc24a..185b3cdc139 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -212,7 +212,7 @@ if ($action == 'create' || empty($action)) { if ($resql) { $obj = $db->fetch_object($resql); $sumpaid = $obj->total; - $db->free(); + $db->free($resql); } print ''.$langs->trans("AlreadyPaid").''.price($sumpaid, 0, $outputlangs, 1, -1, -1, $conf->currency).''; print ''.$langs->trans("RemainderToPay").''.price($total - $sumpaid, 0, $outputlangs, 1, -1, -1, $conf->currency).''; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1d26fb5cfab..b08e31381a1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3523,7 +3523,7 @@ class CommandeFournisseur extends CommonOrder empty($this->receptions[$obj->rowid]) ? $this->receptions[$obj->rowid] = $obj->qty : $this->receptions[$obj->rowid] += $obj->qty; $i++; } - $this->db->free(); + $this->db->free($resql); return $num; } else { diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 47fa5b37846..ac2b967593c 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -244,7 +244,7 @@ if ($action == 'create') { if ($resql) { $obj = $db->fetch_object($resql); $sumpaid = $obj->total; - $db->free(); + $db->free($resql); } print '
'; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 72ec8625e0e..9e097e303c8 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1372,7 +1372,12 @@ class Ticket extends CommonObject $label .= ''.$langs->trans('Ref').': '.$this->ref.'
'; $label .= ''.$langs->trans('TicketTrackId').': '.$this->track_id.'
'; $label .= ''.$langs->trans('Subject').': '.$this->subject; - + if ($this->date_creation) { + $label .= '
'.$langs->trans('DateCreation').': '.$this->date_creation; + } + if ($this->date_modification) { + $label .= '
'.$langs->trans('DateModification').': '.$this->date_modification; + } $url = DOL_URL_ROOT.'/ticket/card.php?id='.$this->id; if ($option != 'nolink') {