From c3a7e8855edbe4f836543184d5a7543e04255a43 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 30 Jan 2013 00:13:54 -0800 Subject: per-agent lpr command, RT#18549 --- FS/FS/Misc.pm | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'FS/FS/Misc.pm') diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm index 096ec8a4c..5e89abc0c 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; -- cgit v1.2.1