HRM : Add an email address in admin to prevent HRM external service (public accountant for exemple)
This commit is contained in:
parent
e673b18871
commit
f602e1fba7
@ -22,7 +22,6 @@
|
||||
*/
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
@ -25,22 +25,43 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load('hrm');
|
||||
$langs->load("hrm");
|
||||
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
// Other parameters HRM_*
|
||||
$list = array (
|
||||
'HRM_EMAIL_EXTERNAL_SERVICE' // To prevent your public accountant for example
|
||||
);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
foreach ($list as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
$page_name = "Parameters";
|
||||
llxHeader('', $langs->trans($page_name));
|
||||
llxHeader('', $langs->trans('Parameters'));
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@ -52,7 +73,40 @@ print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
|
||||
|
||||
// Configuration header
|
||||
$head = hrm_admin_prepare_head();
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'parameters', $langs->trans("HRM"), 0, "user");
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">' . $langs->trans('Journaux') . '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ( $list as $key ) {
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td width="50%"><label for="' . $key . '">' . $label . '</label></td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="' . $key . '" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# Dolibarr language file - en_US - hrm
|
||||
CHARSET=UTF-8
|
||||
|
||||
# Admin
|
||||
HRM_EMAIL_EXTERNAL_SERVICE=Email to prevent HRM external service
|
||||
Establishments=Establishments
|
||||
Establishment=Establishment
|
||||
NewEstablishment=New establishment
|
||||
@ -8,6 +9,7 @@ DeleteEstablishment=Delete establishment
|
||||
ConfirmDeleteEstablishment=Are-you sure to delete this establishment ?
|
||||
OpenEtablishment=Open establishment
|
||||
CloseEtablishment=Close establishment
|
||||
# Module
|
||||
ListOfEmployees=List of employees
|
||||
Employees=Employees
|
||||
Employee=Employee
|
||||
|
||||
Loading…
Reference in New Issue
Block a user