projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changes in db scheme: gl_trans.type_no optimized to int, changed lock_stock.reorder_l...
[fa-stable.git]
/
admin
/
print_profiles.php
diff --git
a/admin/print_profiles.php
b/admin/print_profiles.php
index f22c19416920932ed1fb5ef11d32a1d955c93818..bf3d698f7cc0f0c7911dea339e53b7b4f0b71431 100644
(file)
--- a/
admin/print_profiles.php
+++ b/
admin/print_profiles.php
@@
-9,13
+9,13
@@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security =
15
;
-$path_to_root
=
"..";
+$page_security =
'SA_PRINTPROFILE'
;
+$path_to_root
=
"..";
include($path_to_root . "/includes/session.inc");
include($path_to_root . "/admin/db/printers_db.inc");
include($path_to_root . "/includes/ui.inc");
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','');
$selected_id = get_post('profile_id','');
@@
-23,13
+23,13
@@
$selected_id = get_post('profile_id','');
// Returns array of defined reports
//
function get_reports() {
// Returns array of defined reports
//
function get_reports() {
- global $path_to_root, $
comp_path, $go_debug
;
+ global $path_to_root, $
SysPrefs
;
-if ($
go_debug || !isset($_SESSION['reports'])) {
+if ($
SysPrefs->go_debug || !isset($_SESSION['reports'])) {
// to save time, store in session.
$paths = array (
$path_to_root.'/reporting/',
// 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) {
$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
{
// 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='$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'))
}
//-------------------------------------------------------------------------------------------
if ( get_post('submit'))
@@
-107,7
+105,7
@@
if ( get_post('submit'))
update_printer_profile($_POST['profile_id'], $prof);
if ($selected_id == '') {
display_notification_centered(_('New printing profile has been created'));
update_printer_profile($_POST['profile_id'], $prof);
if ($selected_id == '') {
display_notification_centered(_('New printing profile has been created'));
- clear_form();
+ clear_form(
$selected_id
);
} else {
display_notification_centered(_('Printing profile has been updated'));
}
} else {
display_notification_centered(_('Printing profile has been updated'));
}
@@
-146,7
+144,7
@@
while ($myrow = db_fetch($result)) {
$prints[$myrow['report']] = $myrow['printer'];
}
$prints[$myrow['report']] = $myrow['printer'];
}
-start_table(
$table_style
);
+start_table(
TABLESTYLE
);
$th = array(_("Report Id"), _("Description"), _("Printer"));
table_header($th);
$th = array(_("Report Id"), _("Description"), _("Printer"));
table_header($th);
@@
-160,7
+158,7
@@
foreach(get_reports() as $rep => $descr)
label_cell($descr == '' ? '???<sup>1)</sup>' : _($descr));
$_POST['Prn'.$rep] = isset($prints[$rep]) ? $prints[$rep] : '';
echo '<td>';
label_cell($descr == '' ? '???<sup>1)</sup>' : _($descr));
$_POST['Prn'.$rep] = isset($prints[$rep]) ? $prints[$rep] : '';
echo '<td>';
- printers_list('Prn'.$rep, null,
+
echo
printers_list('Prn'.$rep, null,
$rep == '' ? _('Browser support') : _('Default'));
echo '</td>';
if ($descr == '') $unkn = 1;
$rep == '' ? _('Browser support') : _('Default'));
echo '</td>';
if ($descr == '') $unkn = 1;
@@
-186,4
+184,3
@@
div_end();
end_form();
end_page();
end_form();
end_page();
-?>