Standardize code

This commit is contained in:
Laurent Destailleur 2017-11-23 15:22:32 +01:00
parent b93e35cdd2
commit 6a3dc91414
5 changed files with 26 additions and 19 deletions

View File

@ -2139,11 +2139,13 @@ class AccountLine extends CommonObject
$result=''; $result='';
$label=$langs->trans("ShowTransaction").': '.$this->rowid; $label=$langs->trans("ShowTransaction").': '.$this->rowid;
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$this->rowid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$this->rowid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend='</a>';
if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' '); $result .= $linkstart;
$result.=$link.$this->rowid.$linkend; 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' || $option == 'showconciliated') $result.=' (';
if ($option == 'showall') if ($option == 'showall')

View File

@ -89,6 +89,7 @@ class PaiementFourn extends Paiement
$sql.= ' AND p.rowid = '.$ref; $sql.= ' AND p.rowid = '.$ref;
else if ($fk_bank) else if ($fk_bank)
$sql.= ' AND p.fk_bank = '.$fk_bank; $sql.= ' AND p.fk_bank = '.$fk_bank;
//print $sql;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
@ -548,13 +549,14 @@ class PaiementFourn extends Paiement
} }
$label = $langs->trans("ShowPayment").': '.$text; $label = $langs->trans("ShowPayment").': '.$text;
$link = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkstart = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend = '</a>';
$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; return $result;
} }

View File

@ -52,12 +52,7 @@ if (!empty($conf->variants->enabled)) {
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
$langs->load('bills'); $langs->loadLangs(array('bills','compta','suppliers','companies','products','banks'));
$langs->load('compta');
$langs->load('suppliers');
$langs->load('companies');
$langs->load('products');
$langs->load('banks');
if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); if (!empty($conf->incoterm->enabled)) $langs->load('incoterm');
$id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int')); $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) if ($societe->id > 0)
{ {
// Replacement // Replacement
@ -2439,12 +2434,14 @@ else
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
print '<tr class="oddeven"><td>';
$paymentstatic->id=$objp->rowid; $paymentstatic->id=$objp->rowid;
$paymentstatic->datepaye=$db->jdate($objp->dp); $paymentstatic->datepaye=$db->jdate($objp->dp);
$paymentstatic->ref=($objp->ref ? $objp->ref : $objp->rowid);; $paymentstatic->ref=($objp->ref ? $objp->ref : $objp->rowid);;
$paymentstatic->num_paiement=$objp->num_paiement; $paymentstatic->num_paiement=$objp->num_paiement;
$paymentstatic->payment_code=$objp->payment_code; $paymentstatic->payment_code=$objp->payment_code;
print '<tr class="oddeven">';
print '<td>';
print $paymentstatic->getNomUrl(1); print $paymentstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day') . '</td>'; print '<td>'.dol_print_date($db->jdate($objp->dp), 'day') . '</td>';

View File

@ -296,11 +296,14 @@ if ($result > 0)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$facturestatic->id=$objp->facid;
$facturestatic->ref=($objp->ref?$objp->ref:$objp->rowid);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' '; print '<td>';
print ($objp->ref?$objp->ref:$objp->rowid); print $facturestatic->getNomUrl(1);
print "</a></td>\n"; print "</td>\n";
// Ref supplier // Ref supplier
print '<td>'.$objp->ref_supplier."</td>\n"; print '<td>'.$objp->ref_supplier."</td>\n";
// Third party // Third party

View File

@ -68,6 +68,9 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
-- For 7.0 -- 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; UPDATE llx_website SET entity = 1 WHERE entity IS NULL;
-- VMYSQL4.3 ALTER TABLE llx_website MODIFY COLUMN entity integer NOT NULL DEFAULT 1; -- 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; -- VPGSQL8.2 ALTER TABLE llx_website ALTER COLUMN entity SET NOT NULL;