Skip to content
Snippets Groups Projects
Commit ac408c2e authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: uniformize code

Fix: add permissions in paypal module
parent 04babd92
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ class modPayBox extends DolibarrModules
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png'
$this->picto=DOL_URL_ROOT.'/paybox/img/paybox.png';
$this->picto='paybox@paybox';
// Data directories to create when module is enabled.
$this->dirs = array('/paybox/temp');
......
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
*
* 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
......@@ -65,7 +66,7 @@ class modPaypal extends DolibarrModules
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png'
$this->picto=DOL_URL_ROOT.'/paypal/img/paypal.png';
$this->picto='paypal@paypal';
// Data directories to create when module is enabled.
$this->dirs = array('/paypal/temp');
......@@ -81,7 +82,7 @@ class modPaypal extends DolibarrModules
$this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->phpmin = array(4,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,0,-2); // Minimum version of Dolibarr required by module
$this->langfiles = array("paybox");
$this->langfiles = array("paypal");
// Constants
$this->const = array(); // List of particular constants to add when module is enabled
......@@ -108,14 +109,21 @@ class modPaypal extends DolibarrModules
$this->rights = array(); // Permission array used by this module
$r=0;
// Add here list of permission defined by an id, a label, a boolean and two constant strings.
// Example:
// $this->rights[$r][0] = 2000; // Permission id (must not be already used)
// $this->rights[$r][1] = 'Permision label'; // Permission label
// $this->rights[$r][3] = 1; // Permission by default for new user (0/1)
// $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
// $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
// $r++;
$this->rights[$r][0] = 50201; // id de la permission
$this->rights[$r][1] = 'Read transactions'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecated)
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'transaction';
$this->rights[$r][5] = 'read';
$r++;
$this->rights[$r][0] = 50202; // id de la permission
$this->rights[$r][1] = 'Import transactions'; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecated)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'transaction';
$this->rights[$r][5] = 'import';
$r++;
// Main menu entries
......
......@@ -411,12 +411,14 @@ Module2900Name= GeoIPMaxmind
Module2900Desc= GeoIP Maxmind conversions capabilities
Module5000Name=Multi-company
Module5000Desc=Allows you to manage multiple companies
Module10000Name=PayBox
Module10000Desc=Module to offer an online payment page by credit card with PayBox
Module13452Name=SpeedFinder
Module13452Desc=Search engine in AJAX to find a name from a part of a phone number within 2 seconds
Module50000Name=PayBox
Module50000Desc=Module to offer an online payment page by credit card with PayBox
Module50100Name=Point of sales
Module50100Desc=Point of sales module
Module50200Name= Paypal
Module50200Desc= Module to offer an online payment page by credit card with Paypal
Permission11=Read customer invoices
Permission12=Create/modify customer invoices
Permission13=Unvalidate customer invoices
......@@ -620,6 +622,8 @@ Permission2501=Read documents
Permission2502=Download documents
Permission2503=Submit or delete documents
Permission2515=Setup documents directories
Permission50201= Read transactions
Permission50202= Import transactions
DictionnaryCompanyType=Company types
DictionnaryCompanyJuridicalType=Juridical kinds of company
DictionnaryProspectLevel=Prospect potential level
......
......@@ -412,12 +412,14 @@ Module2900Name= GeoIPMaxmind
Module2900Desc= Capacités de conversion GeoIP Maxmind
Module5000Name= Multi-société
Module5000Desc= Permet de gérer plusieurs sociétés
Module10000Name= PayBox
Module10000Desc= Module permettant d'offrir en ligne une page de paiement par carte de crédit avec PayBox
Module13452Name= SpeedFinder
Module13452Desc= Moteur de recherche en AJAX pour trouver un nom à partir d'une partie d'un numéro de téléphone en 2 secondes
Module50000Name= PayBox
Module50000Desc= Module permettant d'offrir en ligne une page de paiement par carte de crédit avec PayBox
Module50100Name= Point de vente
Module50100Desc= Caisse enregistreuse de point de vente
Module50200Name= Paypal
Module50200Desc= Module permettant d'offrir en ligne une page de paiement par carte de crédit avec Paypal
Permission11= Consulter les factures clients
Permission12= Créer/modifier les factures clients
Permission13= Dé-valider les factures clients
......@@ -629,6 +631,8 @@ Permission2515= Administrer les rubriques de documents
Permission8555= Utilisation du module
Permission8556= Définir les sites ecommerce
Permission8557= Importer les données
Permission50201= Consulter les transactions
Permission50202= Importer les transactions
DictionnaryCompanyType= Types de sociétés
DictionnaryCompanyJuridicalType= Formes juridiques
DictionnaryProspectLevel= Niveau de potentiel des prospects
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypalfunctions.lib.php");
$langs->load("paypal");
// Security check
//$result=restrictedArea($user,'paypal');
$result=restrictedArea($user,'paypal','','','transaction');
$action = GETPOST('action');
$id = GETPOST('id');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment