Javascript libs caching
[fa-stable.git] / admin / display_prefs.php
1 <?php
2
3 $page_security =10;
4 $path_to_root="..";
5 include($path_to_root . "/includes/session.inc");
6
7 page(_("Display Setup"));
8
9 include_once($path_to_root . "/includes/date_functions.inc");
10 include_once($path_to_root . "/includes/ui.inc");
11
12 include_once($path_to_root . "/admin/db/company_db.inc");
13
14 //-------------------------------------------------------------------------------------------------
15
16 if (isset($_POST['setprefs'])) 
17 {
18         $theme = user_theme();
19         set_user_prefs($_POST['prices'], $_POST['Quantities'],
20                 $_POST['Rates'], $_POST['Percent'],
21                 check_value('show_gl'),
22                 check_value('show_codes'),
23                 $_POST['date_format'], $_POST['date_sep'],
24                 $_POST['tho_sep'], $_POST['dec_sep'],
25                 $_POST['theme'], $_POST['page_size']);
26
27         language::set_language($_POST['language']);
28
29         flush_dir($comp_path.'/'.user_company().'/js_cache');   
30
31         if (user_theme() != $theme)
32                 reload_page("");
33
34         display_notification_centered(_("Display settings have been updated."));
35 }
36
37 start_form();
38 start_table($table_style2);
39
40 table_section_title(_("Decimal Places"));
41
42 text_row_ex(_("Prices/Amounts:"), 'prices', 5, 5, user_price_dec());
43 text_row_ex(_("Quantities:"), 'Quantities', 5, 5, user_qty_dec());
44 text_row_ex(_("Exchange Rates:"), 'Rates', 5, 5, user_exrate_dec());
45 text_row_ex(_("Percentages:"), 'Percent',  5, 5, user_percent_dec());
46
47 table_section_title(_("Dateformat and Separators"));
48
49 dateformats_list_row(_("Dateformat:"), "date_format", user_date_format());
50
51 dateseps_list_row(_("Date Separator:"), "date_sep", user_date_sep());
52
53 /* The array $dateseps is set up in config.php for modifications
54 possible separators can be added by modifying the array definition by editing that file */
55
56 thoseps_list_row(_("Thousand Separator:"), "tho_sep", user_tho_sep());
57
58 /* The array $thoseps is set up in config.php for modifications
59 possible separators can be added by modifying the array definition by editing that file */
60
61 decseps_list_row(_("Decimal Separator:"), "dec_sep", user_dec_sep());
62
63 /* The array $decseps is set up in config.php for modifications
64 possible separators can be added by modifying the array definition by editing that file */
65
66 table_section_title(_("Miscellaneous"));
67
68 check_row(_("Show GL Information:"), 'show_gl', user_show_gl_info());
69
70 check_row(_("Show Item Codes:"), 'show_codes', user_show_codes());
71
72 themes_list_row(_("Theme:"), "theme", user_theme());
73
74 /* The array $themes is set up in config.php for modifications
75 possible separators can be added by modifying the array definition by editing that file */
76
77 pagesizes_list_row(_("Page Size:"), "page_size", user_pagesize());
78
79 /* The array $pagesizes is set up in config.php for modifications
80 possible separators can be added by modifying the array definition by editing that file */
81
82 table_section_title(_("Language"));
83
84 if (!isset($_POST['language']))
85         $_POST['language'] = $_SESSION['language']->code;
86
87 languages_list_row(_("Language:"), 'language', $_POST['language']);
88
89 end_table(1);
90
91 submit_center('setprefs', _("Update"));
92
93 end_form(2);
94
95 //-------------------------------------------------------------------------------------------------
96
97 end_page();
98
99 ?>