summaryrefslogtreecommitdiff
path: root/FS/FS/Misc.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-01-30 00:13:54 -0800
committerIvan Kohler <ivan@freeside.biz>2013-01-30 00:13:54 -0800
commitc3a7e8855edbe4f836543184d5a7543e04255a43 (patch)
tree01487f202af429d4a5c61662efc653eb38eef419 /FS/FS/Misc.pm
parentaa97e36a3bb5c92251ab14a47c710ffecb5b26c8 (diff)
per-agent lpr command, RT#18549
Diffstat (limited to 'FS/FS/Misc.pm')
-rw-r--r--FS/FS/Misc.pm22
1 files changed, 19 insertions, 3 deletions
diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm
index 096ec8a..5e89abc 100644
--- a/FS/FS/Misc.pm
+++ b/FS/FS/Misc.pm
@@ -800,16 +800,32 @@ sub _pslatex {
}
-=item do_print ARRAYREF
+=item do_print ARRAYREF [, OPTION => VALUE ... ]
Sends the lines in ARRAYREF to the printer.
+Options available are:
+
+=over 4
+
+=item agentnum
+
+Uses this agent's 'lpr' configuration setting override instead of the global
+value.
+
+=item lpr
+
+Uses this command instead of the configured lpr command (overrides both the
+global value and agentnum).
+
=cut
sub do_print {
- my $data = shift;
+ my( $data, %opt ) = @_;
- my $lpr = $conf->config('lpr');
+ my $lpr = ( exists($opt{'lpr'}) && $opt{'lpr'} )
+ ? $opt{'lpr'}
+ : $conf->config('lpr', $opt{'agentnum'} );
my $outerr = '';
run3 $lpr, $data, \$outerr, \$outerr;