Parse error. besoin de votre aide

fairthy Messages postés 8 Date d'inscription jeudi 23 mars 2006 Statut Membre Dernière intervention 25 mai 2011 - 23 mai 2011 à 14:07
Bobshit75 Messages postés 29 Date d'inscription lundi 28 février 2011 Statut Membre Dernière intervention 13 juillet 2011 - 24 mai 2011 à 10:22
Bonjour à tous et toutes,

bon voilà j'ai un soucis avec un code et je trouve pas l'erreur. j'utiliser dolibarr et je n'arrive plus à avoir accès à mes modules. j'ai l'erreur suivant: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homez.xxx/nomdusite/www/dolibarr/htdocs/includes/modules/modBelgium.class.php on line 34

j'ai été voir le code et je trouve pas ou ça pose problème. le voici:

<?php
/* Copyright (C) 2009-2010 Laurent Léonard <laurent@open-minds.org>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

/**
* \file htdocs/includes/modules/modBelgium.class.php
* \ingroup belgium
* \brief Description and activation file for module Belgium.
* \version 0.1.1
*/

include_once(DOL_DOCUMENT_ROOT . '/includes/modules/DolibarrModules.class.php');

/**
* \class modBelgium
* \brief Description and activation class for module Belgium.
*/
class modBelgium extends DolibarrModules
{
public $boxes;
public $config_page_url;
public $const;
public $const_name;
public $db;
public $depends;
public $description;
public $dirs;
public $family;
public $langfiles;
public $menu;
public $name;
public $need_dolibarr_version;
public $numero;
public $phpmin;
public $picto;
public $requiredby;
public $rights;
public $rights_class;
public $special;
public $style_sheet;
public $version;

/**
* \brief Constructor Define names, constants, directories, boxes, permissions.
* \param db Database handler
*/
function __construct($db)
{
$this->db = $db;

$this->numero = 100000;
$this->rights_class = 'belgium';

$this->family = 'financial';
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = 'Features specific to belgian legislation';
$this->version = '0.1.1';
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
$this->special = 0;
$this->picto = 'belgium@belgium';

$this->dirs = array();

$this->style_sheet = '';

$this->config_page_url = array();

$this->depends = array();
$this->requiredby = array();
$this->phpmin = array(5,2);
$this->need_dolibarr_version = array(2,5);
$this->langfiles = array('@belgium');

$this->const = array();

$this->boxes = array();

$this->rights = array();
$this->rights_class = 'belgium';
$r=0;

$this->rights[$r][0] = 10001;
$this->rights[$r][1] = 'Read VAT clients list';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'vat_list';
$this->rights[$r][5] = 'read';
$r++;

$this->rights[$r][0] = 10002;
$this->rights[$r][1] = 'Export VAT clients list';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'vat_list';
$this->rights[$r][5] = 'export';
$r++;

$this->menu = array();
$r = 0;

$this->menu[$r] = array(
'fk_menu' => 0,
'type' => 'top',
'titre' => 'Belgium',
'mainmenu' => 'belgium',
'leftmenu' => '1',
'url' => '/belgium/index.php',
'langs' => '@belgium',
'position' => 100,
'perms' => '$user->rights->belgium->vat_list->read',
'target' => '',
'user' => 0
);
$r++;

$this->menu[$r] = array(
'fk_menu' => 'r=0',
'type' => 'left',
'titre' => 'Intervat',
'mainmenu' => 'belgium',
'url' => '/belgium/index.php',
'langs' => '@belgium',
'position' => 100,
'perms' => '$user->rights->belgium->vat_list->read',
'target' => '',
'user' => 0
);
$r++;

$this->menu[$r] = array(
'fk_menu' => 'r=1',
'type' => 'left',
'titre' => 'VATClientsList',
'mainmenu' => 'belgium',
'url' => '/belgium/vat_list.php',
'langs' => '@belgium',
'position' => 100,
'perms' => '$user->rights->belgium->vat_list->read',
'target' => '',
'user' => 0
);
$r++;
}

function init()
{
return $this->_init(array());
}

function remove()
{
return $this->_remove(array());
}
}

?>

quelqu'un peut m'aider et me dire ce qui cloche?

merci,

A+

5 réponses

Bobshit75 Messages postés 29 Date d'inscription lundi 28 février 2011 Statut Membre Dernière intervention 13 juillet 2011
23 mai 2011 à 16:19
Dans tes tableaux ce serait déjà pas mieux de mettre ceci :

'perms' => $user->rights->belgium->vat_list->read,


à la place de ceci :

'perms' => '$user->rights->belgium->vat_list->read', 


Je sais pas si ça vient de la, j'en doute un peu, mais il me semble que ça, ça empêche l'accès à l'objet user.
0
cs_47 Messages postés 197 Date d'inscription mardi 20 janvier 2004 Statut Membre Dernière intervention 20 février 2013 1
23 mai 2011 à 18:14
Bonsoir,

La seule fois où j'ai vu ce message d'erreur, c'est en utilisant du code php5 sur du php4 (la visibilité d'une variable public, private, protected est arrivée avec php5)

bonne soirée
0
fairthy Messages postés 8 Date d'inscription jeudi 23 mars 2006 Statut Membre Dernière intervention 25 mai 2011
23 mai 2011 à 19:42
Merci pour vos réponses.
bobshit, ça ne change rien en modifiant les paramètres comme suggéré. merci quand même.

47, je ne comprends pas, je n'ai rien changé et tout fonctionnait très bien.

c'est à ne plus rien comprendre....
0
Bobshit75 Messages postés 29 Date d'inscription lundi 28 février 2011 Statut Membre Dernière intervention 13 juillet 2011
24 mai 2011 à 10:19
Essaye ça à la place de toutes tes déclarations de variables :

<?php
        public $boxes = array();
public $config_page_url = array();
public $const = array();
public $const_name = "";
public $db;
public $depends = array();
public $description = "";
public $dirs = array();
public $family = "";
public $langfiles = array();
public $menu = array();
public $name = "";
public $need_dolibarr_version = array();
public $numero;
public $phpmin = array();
public $picto = "";
public $requiredby = array();
public $rights = array();
public $rights_class = "";
public $special;
public $style_sheet = "";
public $version = "";
?>
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Bobshit75 Messages postés 29 Date d'inscription lundi 28 février 2011 Statut Membre Dernière intervention 13 juillet 2011
24 mai 2011 à 10:22
Ne trouvant pas le bouton d'édition, je t'explique pourquoi ça pourrait venir de là. Ton erreur vient de la ligne 34 soit au début de ta déclaration. Tes variables n'ont pas d'association à un type c'est à dire à un string (=> ""), tableau (=> array()), ou int (=> il me semble que on y met rien).

Voila en espérant que ça fonctionne ;).

Bon courage.
0
Rejoignez-nous