26 require
'../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/salaries.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
36 $langs->loadLangs(array(
'admin',
'salaries'));
43 $action =
GETPOST(
'action',
'aZ09');
47 'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',
54 if ($action ==
'update') {
57 foreach ($list as $constname) {
58 $constvalue =
GETPOST($constname,
'alpha');
60 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
73 if (preg_match(
'/^(set|del)_?([A-Z_]+)$/', $action, $reg)) {
75 if (!
dolibarr_set_const($db, $reg[2], ($reg[1] ===
'set' ?
'1' :
'0'),
'chaine', 0,
'', $conf->entity) > 0) {
84 llxHeader(
'', $langs->trans(
'SalariesSetup'));
91 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
92 print
load_fiche_titre($langs->trans(
'SalariesSetup'), $linkback,
'title_setup');
94 $head = salaries_admin_prepare_head();
101 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
102 print
'<input type="hidden" name="token" value="'.newToken().
'">';
103 print
'<input type="hidden" name="action" value="update">';
108 print
'<table class="noborder centpercent">';
109 print
'<tr class="liste_titre">';
110 print
'<td>'.$langs->trans(
"Parameters").
'</td>';
111 print
'<td width="60">'.$langs->trans(
"Value").
"</td>\n";
114 foreach ($list as $key) {
115 print
'<tr class="oddeven value">';
118 $label = $langs->trans($key);
119 print
'<td class="fieldrequired" width="50%"><label for="'.$key.
'">'.$label.
'</label></td>';
126 print
'<input type="text" size="20" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
137 print
'<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans(
'Modify').
'"></div>';
142 echo
'<table class="noborder centpercent">';
144 echo
'<tr class="liste_titre"><th>' . $langs->trans(
'Parameter') .
'</th><th>' . $langs->trans(
'Value') .
'</th></tr>';
148 $key =
'CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT';
149 echo
'<tr><td>', $langs->trans($key),
'</td><td>',
ajax_constantonoff($key),
'</td></tr>';
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='')
On/off button for constant.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.