From 83644dcb93af52587a9e722811b149211f739029 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Apr 2016 15:38:15 +0200 Subject: [PATCH] Fix errors reported by scrutinizer --- htdocs/accountancy/admin/card.php | 8 +--- .../class/accountancyexport.class.php | 1 - htdocs/core/class/commonobject.class.php | 8 ++-- .../doc/pdf_standard.modules.php | 38 +++++-------------- htdocs/main.inc.php | 2 +- htdocs/public/demo/index.php | 4 -- 6 files changed, 16 insertions(+), 45 deletions(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 04d538b1b31..f1f1218f554 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -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 '
' . "\n"; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index c15bd8e497e..eae0b26d950 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -69,7 +69,6 @@ class AccountancyExport $this->db = &$db; $this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $this->end_line = "\n"; - return 1; } /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 871abf37997..1468b971a45 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index e0f0ed5c13c..5d5e1a50061 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -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); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 732fcb50565..8652af27d82 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -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; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index ad27d097005..02f87a89395 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -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