X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fprint_profiles.php;h=fb959dfb61667893fc12ffaae9666d0915dd4b36;hb=181cd75a7b027c398cc382974bc9f97cba8c48b3;hp=02e3701c55a9a2af8b13a55c1f5f53a16614ca96;hpb=8ea6c4dd0d9b31b3456d012b0c94339b801bee0c;p=fa-stable.git diff --git a/admin/print_profiles.php b/admin/print_profiles.php index 02e3701c..fb959dfb 100644 --- a/admin/print_profiles.php +++ b/admin/print_profiles.php @@ -15,7 +15,7 @@ include($path_to_root . "/includes/session.inc"); include($path_to_root . "/admin/db/printers_db.inc"); include($path_to_root . "/includes/ui.inc"); -page(_("Printing Profiles")); +page(_($help_context = "Printing Profiles")); $selected_id = get_post('profile_id',''); @@ -23,13 +23,13 @@ $selected_id = get_post('profile_id',''); // Returns array of defined reports // function get_reports() { - global $path_to_root, $comp_path, $go_debug; + global $path_to_root, $go_debug; if ($go_debug || !isset($_SESSION['reports'])) { // to save time, store in session. $paths = array ( $path_to_root.'/reporting/', - $comp_path .'/'. user_company() . '/reporting/'); + company_path(). '/reporting/'); $reports = array( '' => _('Default printing destination')); foreach($paths as $dirno => $path) { @@ -77,9 +77,7 @@ function check_delete($name) { // check if selected profile is used by any user if ($name=='') return 0; // cannot delete system default profile - $sql = "SELECT * FROM ".TB_PREF."users WHERE print_profile=".db_escape($name); - $res = db_query($sql,'cannot check printing profile usage'); - return db_num_rows($res); + return key_in_foreign_table($name, 'users', 'print_profile'); } //------------------------------------------------------------------------------------------- if ( get_post('submit')) @@ -146,7 +144,7 @@ while ($myrow = db_fetch($result)) { $prints[$myrow['report']] = $myrow['printer']; } -start_table($table_style); +start_table(TABLESTYLE); $th = array(_("Report Id"), _("Description"), _("Printer")); table_header($th); @@ -160,7 +158,7 @@ foreach(get_reports() as $rep => $descr) label_cell($descr == '' ? '???1)' : _($descr)); $_POST['Prn'.$rep] = isset($prints[$rep]) ? $prints[$rep] : ''; echo ''; - printers_list('Prn'.$rep, null, + echo printers_list('Prn'.$rep, null, $rep == '' ? _('Browser support') : _('Default')); echo ''; if ($descr == '') $unkn = 1;