forked from Wavyzz/dolibarr
Clean code
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/admin/subaccount.php
|
* \file htdocs/accountancy/admin/subaccount.php
|
||||||
* \ingroup Accountancy (Double entries)
|
* \ingroup Accountancy (Double entries)
|
||||||
* \brief List accounting sub-account
|
* \brief List of accounting sub-account (auxiliary accounts)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
@@ -184,7 +184,7 @@ if (strlen(trim($search_subaccount))) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) $sql .= natural_search("sa.nom", $search_label);
|
if (strlen(trim($search_label))) $sql .= natural_search("sa.nom", $search_label);
|
||||||
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$search_type."'";
|
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
||||||
|
|
||||||
// User
|
// User
|
||||||
$sql .= " UNION ";
|
$sql .= " UNION ";
|
||||||
@@ -226,7 +226,7 @@ if (strlen(trim($search_subaccount))) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) $sql .= natural_search("u.lastname", $search_label);
|
if (strlen(trim($search_label))) $sql .= natural_search("u.lastname", $search_label);
|
||||||
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$search_type."'";
|
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
|
|||||||
@@ -179,8 +179,8 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
|||||||
$companystatic->code_compta = $obj->code_compta;
|
$companystatic->code_compta = $obj->code_compta;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$propalstatic->getNomUrl(1).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 16).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||||
print '<td class="nowrap right">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
|
print '<td class="nowrap right">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@@ -243,8 +243,8 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
|||||||
$companystatic->email = $obj->email;
|
$companystatic->email = $obj->email;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$supplierproposalstatic->getNomUrl(1).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'supplier', 16).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
|
||||||
print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@@ -308,8 +308,8 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
|||||||
$companystatic->entity = $obj->entity;
|
$companystatic->entity = $obj->entity;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$orderstatic->getNomUrl(1).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 16).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||||
print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@@ -373,8 +373,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$companystatic->email = $obj->email;
|
$companystatic->email = $obj->email;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$supplierorderstatic->getNomUrl(1).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'supplier', 16).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
|
||||||
print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
|||||||
$companystatic->email = $objp->email;
|
$companystatic->email = $objp->email;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 48).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||||
print '<td class="right" nowrap>'.$companystatic->getLibCustProspStatut().'</td>';
|
print '<td class="right" nowrap>'.$companystatic->getLibCustProspStatut().'</td>';
|
||||||
print '<td class="right" nowrap>'.dol_print_date($db->jdate($objp->tms), 'day').'</td>';
|
print '<td class="right" nowrap>'.dol_print_date($db->jdate($objp->tms), 'day').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@@ -493,7 +493,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$companystatic->email = $objp->email;
|
$companystatic->email = $objp->email;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'supplier', 44).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
|
||||||
print '<td class="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
|
print '<td class="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@@ -213,11 +213,11 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$companystatic->code_compta = $obj->code_compta;
|
$companystatic->code_compta = $obj->code_compta;
|
||||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
print '<tr class="oddeven"><td class="nowrap tdoverflowmax100">';
|
||||||
print $facturestatic->getNomUrl(1, '');
|
print $facturestatic->getNomUrl(1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap tdoverflowmax100">';
|
||||||
print $companystatic->getNomUrl(1, 'customer', 16);
|
print $companystatic->getNomUrl(1, 'customer');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
|
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@@ -305,11 +305,11 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$companystatic->code_compta = $obj->code_compta;
|
$companystatic->code_compta = $obj->code_compta;
|
||||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
print '<tr class="oddeven"><td class="nowrap tdoverflowmax100">';
|
||||||
print $facturesupplierstatic->getNomUrl(1, '', 16);
|
print $facturesupplierstatic->getNomUrl(1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td class="nowrap tdoverflowmax100">';
|
||||||
print $companystatic->getNomUrl(1, 'supplier', 16);
|
print $companystatic->getNomUrl(1, 'supplier');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@@ -550,11 +550,11 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$thirdpartystatic->code_compta = '';
|
$thirdpartystatic->code_compta = '';
|
||||||
$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
print '<tr class="oddeven nowraponall"><td>';
|
print '<tr class="oddeven nowraponall tdoverflowmax100"><td>';
|
||||||
print $facstatic->getNomUrl(1, '');
|
print $facstatic->getNomUrl(1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td class="nowrap tdoverflowmax100">';
|
||||||
print $thirdpartystatic->getNomUrl(1, 'supplier', 44);
|
print $thirdpartystatic->getNomUrl(1, 'supplier');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
|
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
|
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
|
||||||
@@ -647,7 +647,7 @@ if (!empty($conf->don->enabled) && $user->rights->don->lire)
|
|||||||
$label = $donationstatic->getFullName($langs);
|
$label = $donationstatic->getFullName($langs);
|
||||||
if ($objp->societe) $label .= ($label ? ' - ' : '').$objp->societe;
|
if ($objp->societe) $label .= ($label ? ' - ' : '').$objp->societe;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven tdoverflowmax100">';
|
||||||
print '<td>'.$donationstatic->getNomUrl(1).'</td>';
|
print '<td>'.$donationstatic->getNomUrl(1).'</td>';
|
||||||
print '<td>'.$label.'</td>';
|
print '<td>'.$label.'</td>';
|
||||||
print '<td class="nowrap right">'.price($objp->amount).'</td>';
|
print '<td class="nowrap right">'.price($objp->amount).'</td>';
|
||||||
@@ -734,7 +734,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
$chargestatic->paye = $obj->paye;
|
$chargestatic->paye = $obj->paye;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$chargestatic->getNomUrl(1).'</td>';
|
print '<td class="nowraponall">'.$chargestatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
|
print '<td class="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->amount).'</td>';
|
print '<td class="nowrap right">'.price($obj->amount).'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->sumpaid).'</td>';
|
print '<td class="nowrap right">'.price($obj->sumpaid).'</td>';
|
||||||
@@ -875,8 +875,8 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="left">';
|
print '<td class="nowrap tdoverflowmax100">';
|
||||||
print $societestatic->getNomUrl(1, 'customer', 44);
|
print $societestatic->getNomUrl(1, 'customer');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
|
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
|
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
|
||||||
@@ -1022,8 +1022,8 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="left">';
|
print '<td class="nowrap tdoverflowmax100">';
|
||||||
print $societestatic->getNomUrl(1, 'customer', 44);
|
print $societestatic->getNomUrl(1, 'customer');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="right">'.dol_print_date($db->jdate($obj->datelimite), 'day').'</td>';
|
print '<td class="right">'.dol_print_date($db->jdate($obj->datelimite), 'day').'</td>';
|
||||||
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
|
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
|
||||||
@@ -1157,10 +1157,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$societestatic->code_compta = $obj->code_compta;
|
$societestatic->code_compta = $obj->code_compta;
|
||||||
$societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
$societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td class="nowrap tdoverflowmax100">';
|
||||||
print $facstatic->getNomUrl(1, '');
|
print $facstatic->getNomUrl(1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
|
print '<td class="nowrap tdoverflowmax100">'.$societestatic->getNomUrl(1, 'supplier').'</td>';
|
||||||
print '<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement), 'day').'</td>';
|
print '<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement), 'day').'</td>';
|
||||||
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
|
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
|
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
|
||||||
|
|||||||
@@ -106,12 +106,17 @@ abstract class DoliDB implements Database
|
|||||||
/**
|
/**
|
||||||
* Sanitize a string for SQL forging
|
* Sanitize a string for SQL forging
|
||||||
*
|
*
|
||||||
* @param string $stringtosanitize String to escape
|
* @param string $stringtosanitize String to escape
|
||||||
|
* @param int $allowsimplequote Allow simple quote
|
||||||
* @return string String escaped
|
* @return string String escaped
|
||||||
*/
|
*/
|
||||||
public function sanitize($stringtosanitize)
|
public function sanitize($stringtosanitize, $allowsimplequote = 0)
|
||||||
{
|
{
|
||||||
return preg_replace('/[^a-z0-9_\-\.,]/i', '', $stringtosanitize);
|
if ($allowsimplequote) {
|
||||||
|
return preg_replace('/[^a-z0-9_\-\.,\']/i', '', $stringtosanitize);
|
||||||
|
} else {
|
||||||
|
return preg_replace('/[^a-z0-9_\-\.,]/i', '', $stringtosanitize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7828,7 +7828,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||||||
$listofcodes .= "'".$db->escape($val)."'";
|
$listofcodes .= "'".$db->escape($val)."'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -3 ? 'NOT ' : '')."IN (".$db->sanitize($listofcodes).")";
|
$newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -3 ? 'NOT ' : '')."IN (".$db->sanitize($listofcodes, 1).")";
|
||||||
$i2++; // a criteria was added to string
|
$i2++; // a criteria was added to string
|
||||||
}
|
}
|
||||||
if ($mode == -3) $newres .= ' OR '.$field.' IS NULL';
|
if ($mode == -3) $newres .= ' OR '.$field.' IS NULL';
|
||||||
|
|||||||
@@ -1811,8 +1811,8 @@ td.nobordernopadding.widthpictotitle.col-picto {
|
|||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
span.widthpictotitle.pictotitle {
|
span.widthpictotitle.pictotitle {
|
||||||
/* background: rgba(70, 3, 62, 0.5); */
|
|
||||||
background: var(--colortexttitlenotab);
|
background: var(--colortexttitlenotab);
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
@@ -1821,10 +1821,12 @@ span.widthpictotitle.pictotitle {
|
|||||||
min-width: 30px;
|
min-width: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
.pictotitle {
|
.pictotitle {
|
||||||
margin-<?php echo $right; ?>: 8px;
|
margin-<?php echo $right; ?>: 8px;
|
||||||
/* margin-bottom: 4px; */
|
/* margin-bottom: 4px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.pictoobjectwidth {
|
.pictoobjectwidth {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,14 +315,14 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
|
|||||||
.infobox-action{
|
.infobox-action{
|
||||||
color: #b06080 !important;
|
color: #b06080 !important;
|
||||||
}
|
}
|
||||||
.infobox-propal,
|
.infobox-propal:not(.pictotitle),
|
||||||
.infobox-facture,
|
.infobox-facture:not(.pictotitle),
|
||||||
.infobox-commande{
|
.infobox-commande:not(.pictotitle) {
|
||||||
color: #65955d !important;
|
color: #65955d !important;
|
||||||
}
|
}
|
||||||
.infobox-supplier_proposal,
|
.infobox-supplier_proposal:not(.pictotitle),
|
||||||
.infobox-invoice_supplier,
|
.infobox-invoice_supplier:not(.pictotitle),
|
||||||
.infobox-order_supplier{
|
.infobox-order_supplier:not(.pictotitle){
|
||||||
color: #599caf !important;
|
color: #599caf !important;
|
||||||
}
|
}
|
||||||
.infobox-contrat, .infobox-ticket{
|
.infobox-contrat, .infobox-ticket{
|
||||||
|
|||||||
Reference in New Issue
Block a user