Fix errors reported by scrutinizer

This commit is contained in:
Laurent Destailleur 2016-04-09 15:38:15 +02:00
parent f2f672a801
commit 83644dcb93
6 changed files with 16 additions and 45 deletions

View File

@ -216,12 +216,8 @@ if ($action == 'create') {
$head = accounting_prepare_head($object);
// Edit mode
if ($action == 'update') {
$soc = new Societe($db);
if ($object->socid) {
$soc->fetch($object->socid);
}
if ($action == 'update')
{
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";

View File

@ -69,7 +69,6 @@ class AccountancyExport
$this->db = &$db;
$this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$this->end_line = "\n";
return 1;
}
/**

View File

@ -3943,15 +3943,15 @@ abstract class CommonObject
* 3) If not but a constant $conf->global->OBJECTELEMENT_FIELDNAME is set, we return it (It is better to use the dedicated table).
* 4) Return value found into database (TODO No yet implemented)
*
* @param string $fieldname Name of field
* @param string $alternatevalue Alternate value to use
* @return string Default value
* @param string $fieldname Name of field
* @param string $alternatevalue Alternate value to use
* @return string|string[] Default value (can be an array if the GETPOST return an array)
**/
function getDefaultCreateValueFor($fieldname, $alternatevalue=null)
{
global $conf, $_POST;
// If param is has been posted with use this value first.
// If param here has been posted, we use this value first.
if (isset($_POST[$fieldname])) return GETPOST($fieldname, 2);
if (isset($alternatevalue)) return $alternatevalue;

View File

@ -771,42 +771,23 @@ class pdf_standard extends ModeleExpenseReport
// Type
$pdf->line($this->posxtype-1, $tab_top, $this->posxtype-1, $tab_top + $tab_height);
<<<<<<< HEAD
$pdf->SetXY($this->posxtype - 1, $tab_top + 1);
$pdf->MultiCell($this->posxprojet - $this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C');
=======
if (empty($hidetop))
{
$pdf->SetXY($this->posxtype-1, $tab_top+1);
$pdf->MultiCell($this->posxprojet-$this->posxtype-1,2, $outputlangs->transnoentities("Type"),'','C');
$pdf->MultiCell($this->posxprojet-$this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C');
}
>>>>>>> refs/remotes/origin/3.9
<<<<<<< HEAD
if (!empty($conf->projet->enabled)) {
if (!empty($conf->projet->enabled))
{
// Project
$pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxprojet - 1, $tab_top + 1);
$pdf->MultiCell($this->posxtva - $this->posxprojet - 1, 2, $outputlangs->transnoentities("Project"), '', 'C');
if (empty($hidetop))
{
$pdf->SetXY($this->posxprojet - 1, $tab_top + 1);
$pdf->MultiCell($this->posxtva - $this->posxprojet - 1, 2, $outputlangs->transnoentities("Project"), '', 'C');
}
}
=======
// Project
$pdf->line($this->posxprojet-1, $tab_top, $this->posxprojet-1, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxprojet-1, $tab_top+1);
$pdf->MultiCell($this->posxtva-$this->posxprojet-1,2, $outputlangs->transnoentities("Project"),'','C');
}
>>>>>>> refs/remotes/origin/3.9
<<<<<<< HEAD
// VAT
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
$pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxtva - 1, $tab_top + 1);
$pdf->MultiCell($this->posxup - $this->posxtva - 1, 2, $outputlangs->transnoentities("VAT"), '', 'C');
}
=======
// VAT
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
@ -814,10 +795,9 @@ class pdf_standard extends ModeleExpenseReport
if (empty($hidetop))
{
$pdf->SetXY($this->posxtva-1, $tab_top+1);
$pdf->MultiCell($this->posxup-$this->posxtva-1,2, $outputlangs->transnoentities("VAT"),'','C');
$pdf->MultiCell($this->posxup-$this->posxtva - 1, 2, $outputlangs->transnoentities("VAT"), '', 'C');
}
}
>>>>>>> refs/remotes/origin/3.9
// Unit price
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);

View File

@ -925,7 +925,7 @@ if (! function_exists("llxHeader"))
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
* @return void
*/
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
function llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
{
global $conf;

View File

@ -273,9 +273,6 @@ background: -webkit-linear-gradient(bottom, rgb(255,255,255) 85%, rgb(255,255,25
column-count: 2;
}
}
<<<<<<< HEAD
=======
@media only screen and (max-width: 420px)
{
.csscolumns {
@ -284,7 +281,6 @@ background: -webkit-linear-gradient(bottom, rgb(255,255,255) 85%, rgb(255,255,25
column-count: 1;
}
}
>>>>>>> refs/remotes/origin/3.9
</style>
<script type="text/javascript">