Fix: Bugs reported by scrutinizer
This commit is contained in:
parent
d98bfb1d8d
commit
ad661256c0
@ -59,10 +59,10 @@ $max=100;
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader('',$title);
|
|
||||||
|
|
||||||
$title = $langs->trans('FiscalYears');
|
$title = $langs->trans('FiscalYears');
|
||||||
|
|
||||||
|
llxHeader('',$title,LOG_ERR);
|
||||||
|
|
||||||
print_fiche_titre($langs->trans('FiscalYears'));
|
print_fiche_titre($langs->trans('FiscalYears'));
|
||||||
|
|
||||||
$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity";
|
$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity";
|
||||||
|
|||||||
@ -70,7 +70,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$object->getCanvas($rowid);
|
$object->getCanvas($rowid);
|
||||||
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
||||||
$objcanvas='';
|
$objcanvas=null;
|
||||||
if (! empty($canvas))
|
if (! empty($canvas))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||||
@ -79,7 +79,7 @@ if (! empty($canvas))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas);
|
$result=restrictedArea($user, 'adherent', $rowid, '', '', 'fk_soc', 'rowid', $objcanvas);
|
||||||
|
|
||||||
if ($rowid > 0)
|
if ($rowid > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -37,6 +37,8 @@ $typeconst=array('yesno','texte','chaine');
|
|||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
|
|
||||||
|
$type='donation';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
@ -135,7 +137,7 @@ else if ($action == 'setart200') {
|
|||||||
$res = dolibarr_set_const($db, "DONATION_ART200", $setart200, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "DONATION_ART200", $setart200, 'yesno', 0, '', $conf->entity);
|
||||||
if (! $res > 0)
|
if (! $res > 0)
|
||||||
$error ++;
|
$error ++;
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -147,7 +149,7 @@ else if ($action == 'setart238') {
|
|||||||
$res = dolibarr_set_const($db, "DONATION_ART238", $setart238, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "DONATION_ART238", $setart238, 'yesno', 0, '', $conf->entity);
|
||||||
if (! $res > 0)
|
if (! $res > 0)
|
||||||
$error ++;
|
$error ++;
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -159,7 +161,7 @@ else if ($action == 'setart885') {
|
|||||||
$res = dolibarr_set_const($db, "DONATION_ART885", $setart885, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "DONATION_ART885", $setart885, 'yesno', 0, '', $conf->entity);
|
||||||
if (! $res > 0)
|
if (! $res > 0)
|
||||||
$error ++;
|
$error ++;
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -183,7 +185,7 @@ print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup');
|
|||||||
* Params
|
* Params
|
||||||
*/
|
*/
|
||||||
print_titre($langs->trans("Options"));
|
print_titre($langs->trans("Options"));
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||||
@ -207,11 +209,11 @@ print '</form>';
|
|||||||
/*
|
/*
|
||||||
* French params
|
* French params
|
||||||
*/
|
*/
|
||||||
if ($conf->global->MAIN_LANG_DEFAULT == "fr_FR")
|
if ($conf->global->MAIN_LANG_DEFAULT == "fr_FR")
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print_titre($langs->trans("FrenchOptions"));
|
print_titre($langs->trans("FrenchOptions"));
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">' . $langs->trans('Parameters') . '</td>';
|
print '<td colspan="3">' . $langs->trans('Parameters') . '</td>';
|
||||||
@ -377,7 +379,7 @@ if (is_resource($handle))
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $form->textwithpicto('',$htmltooltip,-1,0);
|
print $form->textwithpicto('',$htmltooltip,-1,0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Preview
|
// Preview
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
abstract class CommonObject
|
abstract class CommonObject
|
||||||
{
|
{
|
||||||
protected $db;
|
public $db;
|
||||||
public $error;
|
public $error;
|
||||||
public $errors;
|
public $errors;
|
||||||
public $canvas; // Contains canvas name if it is
|
public $canvas; // Contains canvas name if it is
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class ExtraFields
|
|||||||
var $error;
|
var $error;
|
||||||
var $errno;
|
var $errno;
|
||||||
|
|
||||||
static $type2label=array(
|
public static $type2label=array(
|
||||||
'varchar'=>'String',
|
'varchar'=>'String',
|
||||||
'text'=>'TextLong',
|
'text'=>'TextLong',
|
||||||
'int'=>'Int',
|
'int'=>'Int',
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of admin tabs
|
* Prepare array with list of admin tabs
|
||||||
*
|
*
|
||||||
|
* @param $object Object instance we show card
|
||||||
* @return array Array of tabs to show
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function admin_accounting_prepare_head($object=null)
|
function admin_accounting_prepare_head($object=null)
|
||||||
|
|||||||
@ -74,7 +74,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$canvas = !empty($object->canvas)?$object->canvas:GETPOST("canvas");
|
$canvas = !empty($object->canvas)?$object->canvas:GETPOST("canvas");
|
||||||
$objcanvas='';
|
$objcanvas=null;
|
||||||
if (! empty($canvas))
|
if (! empty($canvas))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||||
|
|||||||
@ -69,7 +69,7 @@ $limit = $conf->liste_limit;
|
|||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$canvas=GETPOST("canvas");
|
$canvas=GETPOST("canvas");
|
||||||
$objcanvas='';
|
$objcanvas=null;
|
||||||
if (! empty($canvas))
|
if (! empty($canvas))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||||
|
|||||||
@ -63,7 +63,7 @@ $search_categ = GETPOST("search_categ");
|
|||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$canvas=GETPOST("canvas");
|
$canvas=GETPOST("canvas");
|
||||||
$objcanvas='';
|
$objcanvas=null;
|
||||||
if (! empty($canvas))
|
if (! empty($canvas))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||||
|
|||||||
@ -65,7 +65,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$object->getCanvas($socid);
|
$object->getCanvas($socid);
|
||||||
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
||||||
$objcanvas='';
|
$objcanvas=null;
|
||||||
if (! empty($canvas))
|
if (! empty($canvas))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user