diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 3cb9f407ce6..9e57830b94d 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -38,8 +38,10 @@ $langs->load("admin"); $langs->load("accountancy"); // Security check -if (! $user->admin) - accessforbidden(); +if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount)) +{ + accessforbidden(); +} $action = GETPOST('action', 'alpha'); @@ -135,31 +137,14 @@ $var = true; /* * Main Options */ + print '
| ' . $langs->trans('MainOptions') . ' | '; +print '' . $langs->trans('Options') . ' | '; print "||||
| ' . $langs->trans("Selectformat") . ' | '; -if (! $conf->use_javascript_ajax) { - print ''; - print $langs->trans("NotAvailableWhenAjaxDisabled"); - print " | "; -} else { - print ''; - $listformat = array ( - 'csv' => $langs->trans("csv"), - 'txt' => $langs->trans("txt") - ); - print $form->selectarray("format", $listformat, $conf->global->ACCOUNTING_EXPORT_FORMAT, 0); - - print ' | '; -} -print "|||
| ' . $langs->trans('OtherOptions') . ' | '; print "|||||
| ' . $langs->trans('OptionsDeactivatedForThisExportModel') . ' | |||||
| ' . $langs->trans("Selectformat") . ' | '; + if (! $conf->use_javascript_ajax) { + print ''; + print $langs->trans("NotAvailableWhenAjaxDisabled"); + print " | "; + } else { + print ''; + $listformat = array ( + 'csv' => $langs->trans("csv"), + 'txt' => $langs->trans("txt") + ); + print $form->selectarray("format", $listformat, $conf->global->ACCOUNTING_EXPORT_FORMAT, 0); + + print ' | '; + } + print "|||
| ' . $langs->trans('OptionMode') . ' | ' . $langs->trans('Description') . ' | '; -print "|
| ' . $langs->trans('OptionModeTrue') . ' | '; -print '' . nl2br($langs->trans('OptionModeTrueDesc'));
-// Write info on way to count VAT
-// if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
-// {
-// // print " \n"; -// // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); -// } -// else -// { -// // print " \n"; -// // print nl2br($langs->trans('OptionModeTrueInfoExpert')); -// } -print " | |
| ' . $langs->trans('OptionModeVirtual') . ' | '; -print '' . nl2br($langs->trans('OptionModeVirtualDesc')) . " | |
| ' . $langs->trans('OptionMode') . ' | ' . $langs->trans('Description') . ' | '; + print "|
| ' . $langs->trans('OptionModeTrue') . ' | '; + print '' . nl2br($langs->trans('OptionModeTrueDesc'));
+ // Write info on way to count VAT
+ // if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
+ // {
+ // // print " \n"; + // // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); + // } + // else + // { + // // print " \n"; + // // print nl2br($langs->trans('OptionModeTrueInfoExpert')); + // } + print " | |
| ' . $langs->trans('OptionModeVirtual') . ' | '; + print '' . nl2br($langs->trans('OptionModeVirtualDesc')) . " | |
| '; + print $langs->trans("Chartofaccounts") . ' | '; + print "||
| " . $langs->trans("Selectchartofaccounts") . " | "; + print ""; + print '"; + print " | |
| ' . $langs->trans('OtherOptions') . ' | '; +print '' . $langs->trans('OtherOptions') . ' | '; print "|||
| '; - - // Value - print ' | '; - print ''; - print ' | |||
| ' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ' | '; + if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ' | '; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ' | '; + } + print '||
| ' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ' | '; + if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ' | '; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ' | '; + } + print '||
| ' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ' | '; + if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ' | '; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ' | '; + } + print '||
| '; - - // Value - print ' | '; - print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1); - print ' | |||
| '; + + // Value + print ' | '; + print ''; + print ' | |||
| ' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ' | '; + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ' | '; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ' | '; + } + print '||
| ' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ' | '; -if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ' | '; -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ' | '; + foreach ( $list_account as $key ) { + $var = ! $var; + + print '||
| '; + + // Value + print ' | '; + print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1); + print ' | |||
| ' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ' | '; -if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ' | '; -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ' | '; -} -print '||
| ' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ' | '; -if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ' | '; -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ' | '; -} -print '||
| ' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ' | '; -if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ' | '; -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ' | '; -} -print '||