Fix not employee must not appear on page to create salaries

This commit is contained in:
Laurent Destailleur 2017-12-18 11:55:34 +01:00
parent 54db0d31b4
commit 8e12551f17
4 changed files with 9 additions and 6 deletions

View File

@ -255,7 +255,8 @@ if ($action == 'create')
// Employee
print '<tr><td>';
print fieldLabel('Employee','fk_user',1).'</td><td>';
print $form->select_dolusers(GETPOST('fk_user','int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$noactive=0; // We keep active and unactive users
print $form->select_dolusers(GETPOST('fk_user','int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive);
print '</td></tr>';
// Label

View File

@ -100,7 +100,7 @@ $salstatic = new PaymentSalary($db);
$userstatic = new User($db);
$accountstatic = new Account($db);
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,";
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,";
$sql.= " pst.code as payment_code";
@ -222,6 +222,7 @@ if ($result)
$userstatic->login=$obj->login;
$userstatic->email=$obj->email;
$userstatic->societe_id=$obj->fk_soc;
$userstatic->statut=$obj->status;
$salstatic->id=$obj->rowid;
$salstatic->ref=$obj->rowid;

View File

@ -1442,7 +1442,7 @@ class Form
* @param array $exclude Array list of users id to exclude
* @param int $disabled If select list must be disabled
* @param array|string $include Array list of users id to include or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
* @param array $enableonly Array list of users id to be enabled. If defined, it means that other must be disabled
* @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled
* @param int $force_entity 0 or Id of environment to force
* @param int $maxlength Maximum length of string into list (0=no limit)
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
@ -1481,7 +1481,7 @@ class Form
$out='';
// On recherche les utilisateurs
// Forge request to select users
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
{

View File

@ -44,6 +44,7 @@ class User extends CommonObject
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $id=0;
public $statut;
public $ldap_sid;
public $search_sid;
public $employee;
@ -56,7 +57,7 @@ class User extends CommonObject
public $address;
public $zip;
public $town;
public $state_id;
public $state_id; // The state/department
public $state_code;
public $state;
public $office_phone;
@ -101,7 +102,6 @@ class User extends CommonObject
public $datelastlogin;
public $datepreviouslogin;
public $statut;
public $photo;
public $lang;
@ -2102,6 +2102,7 @@ class User extends CommonObject
}
$type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
$label.= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type;
$label.= '<br><b>' . $langs->trans("Status").'</b>: '.$this->getLibStatut(0);
$label.='</div>';
// Info Login