mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
NEW expense request and holiday validator fields
This commit is contained in:
parent
847fd8c159
commit
6d4f3f308e
|
|
@ -1492,7 +1492,7 @@ if ($action == 'create')
|
|||
if (empty($include_users)) print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateExpenseReport");
|
||||
else
|
||||
{
|
||||
$defaultselectuser=$user->fk_user; // Will work only if supervisor has permission to approve so is inside include_users
|
||||
$defaultselectuser=!empty($user->fk_user_expense_validator) ? $user->fk_user_expense_validator : $user->fk_user; // Will work only if supervisor has permission to approve so is inside include_users
|
||||
if (! empty($conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR)) $defaultselectuser=$conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR; // Can force default approver
|
||||
if (GETPOST('fk_user_validator', 'int') > 0) $defaultselectuser=GETPOST('fk_user_validator', 'int');
|
||||
$s=$form->select_dolusers($defaultselectuser, "fk_user_validator", 1, "", ((empty($defaultselectuser) || empty($conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR_UNCHANGEABLE))?0:1), $include_users);
|
||||
|
|
|
|||
|
|
@ -1092,7 +1092,7 @@ if ((empty($id) && empty($ref)) || $action == 'add' || $action == 'request' || $
|
|||
if (empty($include_users)) print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays");
|
||||
else
|
||||
{
|
||||
$defaultselectuser=$user->fk_user; // Will work only if supervisor has permission to approve so is inside include_users
|
||||
$defaultselectuser=!empty($user->fk_user_holiday_validator) ? $user->fk_user_holiday_validator : $user->fk_user; // Will work only if supervisor has permission to approve so is inside include_users
|
||||
if (! empty($conf->global->HOLIDAY_DEFAULT_VALIDATOR)) $defaultselectuser=$conf->global->HOLIDAY_DEFAULT_VALIDATOR; // Can force default approver
|
||||
if (GETPOST('valideur', 'int') > 0) $defaultselectuser=GETPOST('valideur', 'int');
|
||||
$s=$form->select_dolusers($defaultselectuser, "valideur", 1, "", 0, $include_users);
|
||||
|
|
|
|||
|
|
@ -223,6 +223,8 @@ if (empty($reshook)) {
|
|||
$object->note = GETPOST("note", 'none');
|
||||
$object->ldap_sid = GETPOST("ldap_sid", 'alphanohtml');
|
||||
$object->fk_user = GETPOST("fk_user", 'int') > 0 ? GETPOST("fk_user", 'int') : 0;
|
||||
$object->fk_user_expense_validator = GETPOST("fk_user_expense_validator", 'int') > 0 ? GETPOST("fk_user_expense_validator", 'int') : 0;
|
||||
$object->fk_user_holiday_validator = GETPOST("fk_user_holiday_validator", 'int') > 0 ? GETPOST("fk_user_holiday_validator", 'int') : 0;
|
||||
$object->employee = GETPOST('employee', 'alphanohtml');
|
||||
|
||||
$object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : '';
|
||||
|
|
@ -376,6 +378,8 @@ if (empty($reshook)) {
|
|||
$object->accountancy_code = GETPOST("accountancy_code", 'alphanohtml');
|
||||
$object->openid = GETPOST("openid", 'alphanohtml');
|
||||
$object->fk_user = GETPOST("fk_user", 'int') > 0 ? GETPOST("fk_user", 'int') : 0;
|
||||
$object->fk_user_expense_validator = GETPOST("fk_user_expense_validator", 'int') > 0 ? GETPOST("fk_user_expense_validator", 'int') : 0;
|
||||
$object->fk_user_holiday_validator = GETPOST("fk_user_holiday_validator", 'int') > 0 ? GETPOST("fk_user_holiday_validator", 'int') : 0;
|
||||
$object->employee = GETPOST('employee', 'int');
|
||||
|
||||
$object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : '';
|
||||
|
|
@ -965,6 +969,26 @@ if ($action == 'create' || $action == 'adduserldap')
|
|||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Expense report validator
|
||||
if(!empty($conf->expensereport->enabled))
|
||||
{
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("UserExpenseValidator").'</td>';
|
||||
print '<td>';
|
||||
print $form->select_dolusers($object->fk_user_expense_validator, 'fk_user_expense_validator', 1, array($object->id), 0, '', 0, $conf->entity, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
// Holiday request validator
|
||||
if(!empty($conf->holiday->enabled))
|
||||
{
|
||||
print '<tr><td class="titlefieldcreate">' . $langs->trans("UserHolidayValidator") . '</td>';
|
||||
print '<td>';
|
||||
print $form->select_dolusers($object->fk_user_holiday_validator, 'fk_user_holiday_validator', 1, array($object->id), 0, '', 0, $conf->entity, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
print '</table><hr><table class="border centpercent">';
|
||||
|
||||
|
|
@ -1562,6 +1586,30 @@ else
|
|||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Expense report validator
|
||||
print '<tr><td>'.$langs->trans("UserExpenseValidator").'</td>';
|
||||
print '<td>';
|
||||
if (empty($object->fk_user_expense_validator)) print $langs->trans("None");
|
||||
else {
|
||||
$evuser=new User($db);
|
||||
$evuser->fetch($object->fk_user_expense_validator);
|
||||
print $evuser->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Holiday request validator
|
||||
print '<tr><td>'.$langs->trans("UserHolidayValidator").'</td>';
|
||||
print '<td>';
|
||||
if (empty($object->fk_user_holiday_validator)) print $langs->trans("None");
|
||||
else {
|
||||
$hvuser=new User($db);
|
||||
$hvuser->fetch($object->fk_user_holiday_validator);
|
||||
print $hvuser->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Position/Job
|
||||
print '<tr><td>'.$langs->trans("PostOrFunction").'</td>';
|
||||
print '<td>'.$object->job.'</td>';
|
||||
|
|
@ -2243,6 +2291,40 @@ else
|
|||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Expense report validator
|
||||
print '<tr><td class="titlefield">'.$langs->trans("UserExpenseValidator").'</td>';
|
||||
print '<td>';
|
||||
if ($caneditfield)
|
||||
{
|
||||
print $form->select_dolusers($object->fk_user_expense_validator, 'fk_user_expense_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="hidden" name="fk_user_expense_validator" value="'.$object->fk_user_expense_validator.'">';
|
||||
$evuser=new User($db);
|
||||
$evuser->fetch($object->fk_user_expense_validator);
|
||||
print $evuser->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Holiday request validator
|
||||
print '<tr><td class="titlefield">'.$langs->trans("UserHolidayValidator").'</td>';
|
||||
print '<td>';
|
||||
if ($caneditfield)
|
||||
{
|
||||
print $form->select_dolusers($object->fk_user_holiday_validator, 'fk_user_holiday_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="hidden" name="fk_user_holiday_validator" value="'.$object->fk_user_holiday_validator.'">';
|
||||
$hvuser=new User($db);
|
||||
$hvuser->fetch($object->fk_user_holiday_validator);
|
||||
print $hvuser->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '</table><hr><table class="border centpercent">';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user