Added query size preference.
[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         if (!is_numeric($_POST['query_size']) || ($_POST['query_size']<1))
19         {
20                 display_error($_POST['query_size']);
21                 display_error( _("Query size must integer and greater than zero."));
22                 set_focus('query_size');
23         } else {
24                 $theme = user_theme();
25                 set_user_prefs($_POST['prices'], $_POST['Quantities'],
26                         $_POST['Rates'], $_POST['Percent'],
27                         check_value('show_gl'),
28                         check_value('show_codes'),
29                         $_POST['date_format'], $_POST['date_sep'],
30                         $_POST['tho_sep'], $_POST['dec_sep'],
31                         $_POST['theme'], $_POST['page_size'], check_value('show_hints'),
32                         $_POST['profile'], check_value('rep_popup'), (int)($_POST['query_size']));
33
34                 language::set_language($_POST['language']);
35
36                 flush_dir($comp_path.'/'.user_company().'/js_cache');   
37
38                 if (user_theme() != $theme)
39                         reload_page("");
40
41                 display_notification_centered(_("Display settings have been updated."));
42         }
43 }
44
45 start_form();
46 start_table($table_style2);
47
48 table_section_title(_("Decimal Places"));
49
50 text_row_ex(_("Prices/Amounts:"), 'prices', 5, 5, '', user_price_dec());
51 text_row_ex(_("Quantities:"), 'Quantities', 5, 5, '', user_qty_dec());
52 text_row_ex(_("Exchange Rates:"), 'Rates', 5, 5, '', user_exrate_dec());
53 text_row_ex(_("Percentages:"), 'Percent',  5, 5, '', user_percent_dec());
54
55 table_section_title(_("Dateformat and Separators"));
56
57 dateformats_list_row(_("Dateformat:"), "date_format", user_date_format());
58
59 dateseps_list_row(_("Date Separator:"), "date_sep", user_date_sep());
60
61 /* The array $dateseps is set up in config.php for modifications
62 possible separators can be added by modifying the array definition by editing that file */
63
64 thoseps_list_row(_("Thousand Separator:"), "tho_sep", user_tho_sep());
65
66 /* The array $thoseps is set up in config.php for modifications
67 possible separators can be added by modifying the array definition by editing that file */
68
69 decseps_list_row(_("Decimal Separator:"), "dec_sep", user_dec_sep());
70
71 /* The array $decseps is set up in config.php for modifications
72 possible separators can be added by modifying the array definition by editing that file */
73
74 table_section_title(_("Miscellaneous"));
75
76 check_row(_("Show hints for new users:"), 'show_hints', user_hints());
77
78 check_row(_("Show GL Information:"), 'show_gl', user_show_gl_info());
79
80 check_row(_("Show Item Codes:"), 'show_codes', user_show_codes());
81
82 themes_list_row(_("Theme:"), "theme", user_theme());
83
84 /* The array $themes is set up in config.php for modifications
85 possible separators can be added by modifying the array definition by editing that file */
86
87 pagesizes_list_row(_("Page Size:"), "page_size", user_pagesize());
88
89 /* The array $pagesizes is set up in config.php for modifications
90 possible separators can be added by modifying the array definition by editing that file */
91
92 if (!isset($_POST['profile']))
93         $_POST['profile'] = user_print_profile();
94
95 print_profiles_list_row(_("Printing profile"). ':', 'profile', 
96         null, _('Browser printing support'));
97
98 check_row(_("Use popup window to display reports:"), 'rep_popup', user_rep_popup(),
99         false, _('Set this option to on if your browser directly supports pdf files'));
100
101 text_row_ex(_("Query page size:"), 'query_size',  5, 5, '', user_query_size());
102
103 table_section_title(_("Language"));
104
105 if (!isset($_POST['language']))
106         $_POST['language'] = $_SESSION['language']->code;
107
108 languages_list_row(_("Language:"), 'language', $_POST['language']);
109
110 end_table(1);
111
112 submit_center('setprefs', _("Update"), true, '', true);
113
114 end_form(2);
115
116 //-------------------------------------------------------------------------------------------------
117
118 end_page();
119
120 ?>