From 6a3dc9141448cb340c1503bea223c451790b25f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Nov 2017 15:22:32 +0100 Subject: [PATCH] Standardize code --- htdocs/compta/bank/class/account.class.php | 8 +++++--- htdocs/fourn/class/paiementfourn.class.php | 12 +++++++----- htdocs/fourn/facture/card.php | 13 +++++-------- htdocs/fourn/paiement/card.php | 9 ++++++--- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 3 +++ 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ef567c4cecb..0747bb9543f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2139,11 +2139,13 @@ class AccountLine extends CommonObject $result=''; $label=$langs->trans("ShowTransaction").': '.$this->rowid; - $link = ''; + $linkstart = ''; $linkend=''; - if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' '); - $result.=$link.$this->rowid.$linkend; + $result .= $linkstart; + if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'account'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + if ($withpicto != 2) $result.=($this->ref?$this->ref:$this->rowid); + $result .= $linkend; if ($option == 'showall' || $option == 'showconciliated') $result.=' ('; if ($option == 'showall') diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 3857d5053f4..16a3fa70a2f 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -89,6 +89,7 @@ class PaiementFourn extends Paiement $sql.= ' AND p.rowid = '.$ref; else if ($fk_bank) $sql.= ' AND p.fk_bank = '.$fk_bank; + //print $sql; $resql = $this->db->query($sql); if ($resql) @@ -548,13 +549,14 @@ class PaiementFourn extends Paiement } $label = $langs->trans("ShowPayment").': '.$text; - $link = ''; - $linkend=''; + $linkstart = ''; + $linkend = ''; + $result .= $linkstart; + if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + if ($withpicto != 2) $result.= $this->ref; + $result .= $linkend; - if ($withpicto) $result.=($link.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$linkend); - if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.$text.$linkend; return $result; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 69c1241ba3e..a87ae0d13ae 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -52,12 +52,7 @@ if (!empty($conf->variants->enabled)) { if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; -$langs->load('bills'); -$langs->load('compta'); -$langs->load('suppliers'); -$langs->load('companies'); -$langs->load('products'); -$langs->load('banks'); +$langs->loadLangs(array('bills','compta','suppliers','companies','products','banks')); if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); $id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int')); @@ -1601,7 +1596,7 @@ if ($action == 'create') } */ - /* Not yet supporter for supplier + /* Not yet supported for supplier if ($societe->id > 0) { // Replacement @@ -2439,12 +2434,14 @@ else { $objp = $db->fetch_object($result); - print ''; $paymentstatic->id=$objp->rowid; $paymentstatic->datepaye=$db->jdate($objp->dp); $paymentstatic->ref=($objp->ref ? $objp->ref : $objp->rowid);; $paymentstatic->num_paiement=$objp->num_paiement; $paymentstatic->payment_code=$objp->payment_code; + + print ''; + print ''; print $paymentstatic->getNomUrl(1); print ''; print ''.dol_print_date($db->jdate($objp->dp), 'day') . ''; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 14eca2c58d0..6023e7c050a 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -296,11 +296,14 @@ if ($result > 0) { $objp = $db->fetch_object($resql); + $facturestatic->id=$objp->facid; + $facturestatic->ref=($objp->ref?$objp->ref:$objp->rowid); + print ''; // Ref - print ''.img_object($langs->trans('ShowBill'),'bill').' '; - print ($objp->ref?$objp->ref:$objp->rowid); - print "\n"; + print ''; + print $facturestatic->getNomUrl(1); + print "\n"; // Ref supplier print ''.$objp->ref_supplier."\n"; // Third party diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 84922368b22..7a27fff3218 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -68,6 +68,9 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer; -- For 7.0 +UPDATE llx_paiementfourn SET ref = rowid WHERE ref IS NULL; +UPDATE llx_paiementfourn SET entity = 1 WHERE entity IS NULL; + UPDATE llx_website SET entity = 1 WHERE entity IS NULL; -- VMYSQL4.3 ALTER TABLE llx_website MODIFY COLUMN entity integer NOT NULL DEFAULT 1; -- VPGSQL8.2 ALTER TABLE llx_website ALTER COLUMN entity SET NOT NULL;