Remove admin access on option
This commit is contained in:
parent
498431fa6f
commit
c3a23b0415
@ -226,82 +226,78 @@ print '<tr class="liste_titre">';
|
|||||||
print '<td colspan="2">'.$langs->trans('Options').'</td>';
|
print '<td colspan="2">'.$langs->trans('Options').'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if (!empty($user->admin))
|
// TO DO Mutualize code for yes/no constants
|
||||||
|
|
||||||
|
/* Set this option as a hidden option but keep it for some needs.
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
|
||||||
|
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setenabledraftexport&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setenabledraftexport&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
|
||||||
|
if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisabledirectinput&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisabledirectinput&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX").'</td>';
|
||||||
|
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setenablesubsidiarylist&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setenablesubsidiarylist&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans("ACCOUNTING_MANAGE_ZERO").'</td>';
|
||||||
|
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setmanagezero&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setmanagezero&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Param a user $user->rights->accounting->chartofaccount can access
|
||||||
|
foreach ($list as $key)
|
||||||
{
|
{
|
||||||
// TO DO Mutualize code for yes/no constants
|
print '<tr class="oddeven value">';
|
||||||
|
|
||||||
/* Set this option as a hidden option but keep it for some needs.
|
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
|
// Param
|
||||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
|
$label = $langs->trans($key);
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setenabledraftexport&value=0">';
|
print '<td>'.$label.'</td>';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
// Value
|
||||||
print '</a></td>';
|
print '<td class="right">';
|
||||||
} else {
|
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setenabledraftexport&value=1">';
|
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print '</td>';
|
||||||
print '</a></td>';
|
|
||||||
}
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
*/
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
|
|
||||||
if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisabledirectinput&value=0">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a></td>';
|
|
||||||
} else {
|
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisabledirectinput&value=1">';
|
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
print '</a></td>';
|
|
||||||
}
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX").'</td>';
|
|
||||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setenablesubsidiarylist&value=0">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a></td>';
|
|
||||||
} else {
|
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setenablesubsidiarylist&value=1">';
|
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
print '</a></td>';
|
|
||||||
}
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("ACCOUNTING_MANAGE_ZERO").'</td>';
|
|
||||||
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setmanagezero&value=0">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a></td>';
|
|
||||||
} else {
|
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setmanagezero&value=1">';
|
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
print '</a></td>';
|
|
||||||
}
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Param a user $user->rights->accounting->chartofaccount can access
|
|
||||||
foreach ($list as $key)
|
|
||||||
{
|
|
||||||
print '<tr class="oddeven value">';
|
|
||||||
|
|
||||||
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
|
||||||
|
|
||||||
// Param
|
|
||||||
$label = $langs->trans($key);
|
|
||||||
print '<td>'.$label.'</td>';
|
|
||||||
// Value
|
|
||||||
print '<td class="right">';
|
|
||||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -312,58 +308,53 @@ print '<tr class="liste_titre">';
|
|||||||
print '<td colspan="2">'.$langs->trans('BindingOptions').'</td>';
|
print '<td colspan="2">'.$langs->trans('BindingOptions').'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if (!empty($user->admin))
|
// TO DO Mutualize code for yes/no constants
|
||||||
{
|
print '<tr class="oddeven">';
|
||||||
// TO DO Mutualize code for yes/no constants
|
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").'</td>';
|
||||||
print '<tr class="oddeven">';
|
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").'</td>';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsorttodo&value=0">';
|
||||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsorttodo&value=0">';
|
print '</a></td>';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
} else {
|
||||||
print '</a></td>';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsorttodo&value=1">';
|
||||||
} else {
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsorttodo&value=1">';
|
print '</a></td>';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
print '</a></td>';
|
|
||||||
}
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").'</td>';
|
|
||||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsortdone&value=0">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a></td>';
|
|
||||||
} else {
|
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsortdone&value=1">';
|
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
print '</a></td>';
|
|
||||||
}
|
|
||||||
print '</tr>';
|
|
||||||
}
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").'</td>';
|
||||||
|
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsortdone&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsortdone&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Param a user $user->rights->accounting->chartofaccount can access
|
// Param a user $user->rights->accounting->chartofaccount can access
|
||||||
foreach ($list_binding as $key)
|
foreach ($list_binding as $key)
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven value">';
|
print '<tr class="oddeven value">';
|
||||||
|
|
||||||
// Param
|
// Param
|
||||||
$label = $langs->trans($key);
|
$label = $langs->trans($key);
|
||||||
print '<td>'.$label.'</td>';
|
print '<td>'.$label.'</td>';
|
||||||
// Value
|
// Value
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($key == 'ACCOUNTING_DATE_START_BINDING') {
|
if ($key == 'ACCOUNTING_DATE_START_BINDING') {
|
||||||
print $form->selectDate(($conf->global->$key ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1);
|
print $form->selectDate(($conf->global->$key ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1);
|
||||||
} else {
|
} else {
|
||||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
print '</tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user