2
0
forked from Wavyzz/dolibarr
marcosgdf-task-1793

Conflicts:
	ChangeLog
	htdocs/margin/lib/margins.lib.php
This commit is contained in:
Laurent Destailleur
2015-01-31 14:29:15 +01:00
6 changed files with 36 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -34,7 +35,12 @@ $langs->load("products");
$langs->load("margins");
// Security check
$agentid = GETPOST('agentid','int');
if ($user->rights->margin->read->all) {
$agentid = GETPOST('agentid', 'int');
} else {
$agentid = $user->id;
}
$mesg = '';
@@ -85,10 +91,12 @@ dol_fiche_head($head, 'agentMargins', $titre, 0, $picto);
print '<form method="post" name="sel" action="'.$_SERVER['PHP_SELF'].'">';
print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans('SalesRepresentative').'</td>';
print '<td colspan="4">';
print $form->select_dolusers($agentid,'agentid',1);
print '</td></tr>';
if ($user->rights->margin->read->all) {
print '<tr><td width="20%">'.$langs->trans('SalesRepresentative').'</td>';
print '<td colspan="4">';
print $form->select_dolusers($agentid, 'agentid', 1);
print '</td></tr>';
}
// Start date
print '<td>'.$langs->trans('StartDate').' ('.$langs->trans("DateValidation").')</td>';

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -77,10 +77,15 @@ function marges_prepare_head()
$h++;
}
if ($user->rights->margin->read->all) {
$title = 'UserMargins';
} else {
$title = 'SalesRepresentativeMargins';
}
$head[$h][0] = DOL_URL_ROOT."/margin/agentMargins.php";
$head[$h][1] = $langs->trans("SalesRepresentativeMargins");
$head[$h][1] = $langs->trans($title);
$head[$h][2] = 'agentMargins';
$h++;
return $head;
}