Added optional dbpager header and footer
[fa-stable.git] / admin / display_prefs.php
index cafb4527dbced802e896b8553edb2e7e7a4c2ee0..35a1c636a46f48ae1213f84e053b4f98df98b9a8 100644 (file)
@@ -15,23 +15,31 @@ include_once($path_to_root . "/admin/db/company_db.inc");
 
 if (isset($_POST['setprefs'])) 
 {
-       $theme = user_theme();
-       set_user_prefs($_POST['prices'], $_POST['Quantities'],
-               $_POST['Rates'], $_POST['Percent'],
-               check_value('show_gl'),
-               check_value('show_codes'),
-               $_POST['date_format'], $_POST['date_sep'],
-               $_POST['tho_sep'], $_POST['dec_sep'],
-               $_POST['theme'], $_POST['page_size']);
-
-       language::set_language($_POST['language']);
-
-       flush_dir($comp_path.'/'.user_company().'/js_cache');   
-
-       if (user_theme() != $theme)
-               reload_page("");
-
-       display_notification_centered(_("Display settings have been updated."));
+       if (!is_numeric($_POST['query_size']) || ($_POST['query_size']<1))
+       {
+               display_error($_POST['query_size']);
+               display_error( _("Query size must integer and greater than zero."));
+               set_focus('query_size');
+       } else {
+               $theme = user_theme();
+               set_user_prefs($_POST['prices'], $_POST['Quantities'],
+                       $_POST['Rates'], $_POST['Percent'],
+                       check_value('show_gl'),
+                       check_value('show_codes'),
+                       $_POST['date_format'], $_POST['date_sep'],
+                       $_POST['tho_sep'], $_POST['dec_sep'],
+                       $_POST['theme'], $_POST['page_size'], check_value('show_hints'),
+                       $_POST['profile'], check_value('rep_popup'), (int)($_POST['query_size']));
+
+               language::set_language($_POST['language']);
+
+               flush_dir($comp_path.'/'.user_company().'/js_cache');   
+
+               if (user_theme() != $theme)
+                       reload_page("");
+
+               display_notification_centered(_("Display settings have been updated."));
+       }
 }
 
 start_form();
@@ -39,10 +47,10 @@ start_table($table_style2);
 
 table_section_title(_("Decimal Places"));
 
-text_row_ex(_("Prices/Amounts:"), 'prices', 5, 5, user_price_dec());
-text_row_ex(_("Quantities:"), 'Quantities', 5, 5, user_qty_dec());
-text_row_ex(_("Exchange Rates:"), 'Rates', 5, 5, user_exrate_dec());
-text_row_ex(_("Percentages:"), 'Percent',  5, 5, user_percent_dec());
+text_row_ex(_("Prices/Amounts:"), 'prices', 5, 5, '', user_price_dec());
+text_row_ex(_("Quantities:"), 'Quantities', 5, 5, '', user_qty_dec());
+text_row_ex(_("Exchange Rates:"), 'Rates', 5, 5, '', user_exrate_dec());
+text_row_ex(_("Percentages:"), 'Percent',  5, 5, '', user_percent_dec());
 
 table_section_title(_("Dateformat and Separators"));
 
@@ -65,6 +73,8 @@ possible separators can be added by modifying the array definition by editing th
 
 table_section_title(_("Miscellaneous"));
 
+check_row(_("Show hints for new users:"), 'show_hints', user_hints());
+
 check_row(_("Show GL Information:"), 'show_gl', user_show_gl_info());
 
 check_row(_("Show Item Codes:"), 'show_codes', user_show_codes());
@@ -79,6 +89,17 @@ pagesizes_list_row(_("Page Size:"), "page_size", user_pagesize());
 /* The array $pagesizes is set up in config.php for modifications
 possible separators can be added by modifying the array definition by editing that file */
 
+if (!isset($_POST['profile']))
+       $_POST['profile'] = user_print_profile();
+
+print_profiles_list_row(_("Printing profile"). ':', 'profile', 
+       null, _('Browser printing support'));
+
+check_row(_("Use popup window to display reports:"), 'rep_popup', user_rep_popup(),
+       false, _('Set this option to on if your browser directly supports pdf files'));
+
+text_row_ex(_("Query page size:"), 'query_size',  5, 5, '', user_query_size());
+
 table_section_title(_("Language"));
 
 if (!isset($_POST['language']))
@@ -88,7 +109,7 @@ languages_list_row(_("Language:"), 'language', $_POST['language']);
 
 end_table(1);
 
-submit_center('setprefs', _("Update"));
+submit_center('setprefs', _("Update"), true, '', true);
 
 end_form(2);