Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-07-23 11:42:58 +02:00
commit 7983a83466
13 changed files with 59 additions and 85 deletions

View File

@ -1,3 +0,0 @@
div.mainmenu.commissions {
background : url('../img/commissions.png') no-repeat 20px 0;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 651 B

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> /* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
* 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
@ -16,28 +16,27 @@
*/ */
/** /**
* \file htdocs/custom/commissions/index.php * \file htdocs/commissions/index.php
* \ingroup commissions * \ingroup commissions
* \brief Page des commissions par agent commercial * \brief Page des commissions par agent commercial
* \version $Id: facture.php,v 1.84 2011/08/08 16:07:47 eldy Exp $
*/ */
require("../main.inc.php"); require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
if ($conf->marges->enabled) if (! empty($conf->margin->enabled))
require_once(DOL_DOCUMENT_ROOT."/marges/lib/marges.lib.php"); require_once(DOL_DOCUMENT_ROOT."/margin/lib/margins.lib.php");
$langs->load("companies"); $langs->load("companies");
$langs->load("bills"); $langs->load("bills");
$langs->load("products"); $langs->load("products");
if ($conf->marges->enabled)
$langs->load("marges");
$langs->load("commissions"); $langs->load("commissions");
if (! empty($conf->margin->enabled))
$langs->load("margins");
// Security check // Security check
$agentid = isset($_REQUEST["agentid"])?$_REQUEST["agentid"]:''; $agentid = GETPOST('agentid','int');
$mesg = ''; $mesg = '';
@ -91,7 +90,7 @@ else {
if (! $sortfield) $sortfield="u.login"; if (! $sortfield) $sortfield="u.login";
} }
// Date début // Date d<EFBFBD>but
print '<td>'.$langs->trans('StartDate').'</td>'; print '<td>'.$langs->trans('StartDate').'</td>';
print '<td width="20%">'; print '<td width="20%">';
$form->select_date($startdate,'startdate','','',1,"sel",1,1); $form->select_date($startdate,'startdate','','',1,"sel",1,1);
@ -288,12 +287,11 @@ else
} }
$db->free($result); $db->free($result);
$db->close();
llxFooter('$Date: 2011/08/08 16:07:47 $ - $Revision: 1.84 $'); llxFooter();
$db->close();
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("#agentid").change(function() { $("#agentid").change(function() {
@ -308,5 +306,4 @@ $(document).ready(function() {
$("#totalCommission").html("<?php echo price($cumul_commission_produit + $cumul_commission_service); ?>"); $("#totalCommission").html("<?php echo price($cumul_commission_produit + $cumul_commission_service); ?>");
}); });
</script> </script>

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> /* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
* 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
@ -12,14 +12,12 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*/ */
/** /**
* \file /marges/lib/commissions.lib.php * \file /htdocs/commissions/lib/commissions.lib.php
* \ingroup marges * \ingroup commissions
* \brief Library for common commissions functions * \brief Library for common commissions functions
*/ */
@ -35,7 +33,7 @@ function commissions_admin_prepare_head()
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = dol_buildpath("/commissions/admin/commissions.php",1); $head[$h][0] = DOL_URL_ROOT.'/commissions/admin/commissions.php';
$head[$h][1] = $langs->trans("Parameters"); $head[$h][1] = $langs->trans("Parameters");
$head[$h][2] = 'parameters'; $head[$h][2] = 'parameters';
$h++; $h++;
@ -44,7 +42,7 @@ function commissions_admin_prepare_head()
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'margesadmin'); complete_head_from_modules($conf,$langs,$object,$head,$h,'commissionsadmin');
return $head; return $head;
} }

View File

@ -380,7 +380,7 @@ class DoliDBPgsql
if (! $name) $name="postgres"; // When try to connect using admin user if (! $name) $name="postgres"; // When try to connect using admin user
// try first Unix domain socket (local) // try first Unix domain socket (local)
if ((empty($host) || $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT')) if ((! empty($host) && $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT'))
{ {
$con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty $con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty
$this->db = pg_connect($con_string); $this->db = pg_connect($con_string);

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> /* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
* 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
@ -16,14 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/** \defgroup mymodule Module MyModule
* \brief Module to manage commissions
*/
/** /**
* \file htdocs/includes/modules/modCommissions.class.php * \defgroup commissions Module Commissions
* \ingroup commissions * \brief Example of a module descriptor.
* \brief Description and activation file for module Commissions * \file htdocs/core/modules/modCommissions.class.php
* \ingroup commissions
* \brief Description and activation file for module Commissions
*/ */
include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
@ -34,11 +32,11 @@ include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
class modCommissions extends DolibarrModules class modCommissions extends DolibarrModules
{ {
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function modCommissions($db) function __construct($db)
{ {
$this->db = $db; $this->db = $db;
@ -52,7 +50,7 @@ class modCommissions extends DolibarrModules
// It is used to group modules in module setup page // It is used to group modules in module setup page
$this->family = "financial"; $this->family = "financial";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = mb_ereg_replace('^mod','',get_class($this), "i"); $this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "Commissions management"; $this->description = "Commissions management";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
@ -67,43 +65,27 @@ class modCommissions extends DolibarrModules
// Data directories to create when module is enabled. // Data directories to create when module is enabled.
$this->dirs = array(); $this->dirs = array();
//$this->dirs[0] = DOL_DATA_ROOT.'/Marges';
//$this->dirs[1] = DOL_DATA_ROOT.'/mymodule/temp;
// Relative path to module style sheet if exists. Example: '/mymodule/mycss.css'.
$this->style_sheet = '/commissions/css/commissions.css';
// Config pages. Put here list of php page names stored in admmin directory used to setup module. // Config pages. Put here list of php page names stored in admmin directory used to setup module.
$this->config_page_url = array("commissions.php"); $this->config_page_url = array("commissions.php");
// Dependencies // Dependencies
$this->depends = array("modFacture", "modMarges"); // List of modules id that must be enabled if this module is enabled $this->depends = array("modFacture", "modMargin"); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled $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->phpmin = array(5,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,1); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(3,2); // Minimum version of Dolibarr required by module
$this->langfiles = array("commissions"); $this->langfiles = array("commissions");
// Constants // Constants
$this->const = array(); // List of particular constants to add when module is enabled $this->const = array(); // List of particular constants to add when module is enabled
//$this->const = array( 0=>array('MAIN_MODULE_MARGES_HOOKS', 'chaine', 'propalcard', 'Hooks list for displaying Marges data on entity lists', 0, 'current', 1) );
// New pages on tabs // New pages on tabs
$this->tabs = array( $this->tabs = array();
);
// Boxes // Boxes
$this->boxes = array(); // List of boxes $this->boxes = array(); // List of boxes
$r=0; $r=0;
// Add here list of php file(s) stored in includes/boxes that contains class to show a box.
// Example:
//$this->boxes[$r][1] = "myboxa.php";
//$r++;
//$this->boxes[$r][1] = "myboxb.php";
//$r++;
// Permissions // Permissions
$this->rights = array(); // Permission array used by this module $this->rights = array(); // Permission array used by this module
$r=0; $r=0;
@ -122,8 +104,9 @@ class modCommissions extends DolibarrModules
$this->menu = array(); // List of menus to add $this->menu = array(); // List of menus to add
$r = 0; $r = 0;
// left menu entry // left menu entry
$this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu $this->menu[$r]=array(
'fk_menu'=>0, // Put 0 if this is a top menu
'type'=>'top', // This is a Top menu entry 'type'=>'top', // This is a Top menu entry
'titre'=>'Commissions', 'titre'=>'Commissions',
'mainmenu'=>'commissions', 'mainmenu'=>'commissions',
@ -135,8 +118,7 @@ class modCommissions extends DolibarrModules
'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules 'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;
} }
/** /**

View File

@ -1,4 +1,4 @@
# Dolibarr language file - fr_FR - marges # Dolibarr language file - fr_FR - commissions
CHARSET=UTF-8 CHARSET=UTF-8
commissionsSetup=Paramétrage de la gestion des commissions commissionsSetup=Paramétrage de la gestion des commissions

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB