Bug 2045

Summary: Network Printers Setting Does Nothing?
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: System AdministrationAssignee: Paul Poulain <paul.poulain>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: rel_3_0   
Hardware: PC   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17845
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Chris Cormack 2010-05-21 00:37:34 UTC


---- Reported by nengard@gmail.com 2008-04-24 09:44:27 ----

I'm writing the manual and this option seems to be unnecessary for users.  The suggestion below is that we remove it.

<nengard> question about network printers - can someone give me an example of what to enter in each of the three fields? (printer name, queue, type) ... and where do these come from - do they just match the printer settings on your computer?
 <atz> nengard: this is for printers attached to the SERVER
 <nengard> atz - that i figured, but not sure what to enter in those fields
 <atz> it has nothing to do w/ the client
 <atz> could be anything....
 <rch> i would like to suggest that we hide the network printer definition in default template.
 <atz> like: lp3170n; #atz; 
 <atz> i don't know what "type" refers to
 <nengard> rch should i write up a bug report or just leave it to you?
 <rch> anybody see a reason not to remove it ?
 <atz> anybody we know using it?
 <rch> it needs to be set up by an admin anyway, so they can add it to the template
 <rch> nobody uses it, and it causes a lot of unnecessary support questions
 <atz> true
 <rch> nengard: a bug report would be good.  then someone might offer a reason to keep it
 <nengard> okey dokey - will do



---- Additional Comments From jmf@liblime.com 2008-05-19 13:47:37 ----

There's no real reason to remove it -- it's used by a few libraries out there that have a network printer. AFAIK it works fine, so I vote to keep it and close this bug out (which I've one with this message ;-)).



---- Additional Comments From rch@liblime.com 2008-05-19 21:23:58 ----

imo, there is a real reason to remove it.
Its presence distracts people from the default behaviour of Koha as a web app.  The default behaviour is to print through the browser, as any other web app does.    This should only be visible where it is used; without another interface to configure network devices, it makes people think they can configure their printers through Koha, which without customization of the code, they cannot.

Any system preference that requires custom coding should not be present without explicit instructions on how to make it work.





---- Additional Comments From jmf@liblime.com 2008-05-20 03:01:08 ----

What if we just specify in the template that this feature requires custom programming and point to some documentation on how it works..



---- Additional Comments From joe.atzberger@liblime.com 2008-05-31 01:09:53 ----

I'm with Ryan on this one.  We should hide it or suffer.  

We see multiple label/barcode/slip printing questions from clients every week, and users have no idea what the relationship between Koha and their printer is.  They say "hey I have an HP 3160n, the 'n' is for 'network'" and conclude that this "network printer" setting is going to let them target it.  

You can't really document how to setup every kind of printer on arbitrary hardware, in an unspecified network environment, on an unknown OS.  (Then: middleware, drivers, queues, firewalls, trays, etc.)

I've been looking at this code for 45 minutes, and I am positive it cannot work for anyone.  It all comes down to C4::Print::remoteprint that starts:


sub remoteprint ($$) {
    my ($items, $borrower) = @_;

    (return)
      unless ( C4::Context->boolean_preference('printcirculationslips') );
    my $queue = '';

    # FIXME - If 'queue' is undefined or empty, then presumably it should
    # mean "use the default queue", whatever the default is. Presumably
    # the default depends on the physical location of the machine.
    # FIXME - Perhaps "print to file" should be a supported option. Just
    # set the queue to "file" (or " file", if real queues aren't allowed
    # to have spaces in them). Or perhaps if $queue eq "" and
    # $env->{file} ne "", then that should mean "print to $env->{file}".
    if ( $queue eq "" || $queue eq 'nulllp' ) {
        open( PRINTER, ">/tmp/kohaiss" );
    } 
[..snip..]

Well, after a lot of deliberation there, the coders ended up with:
  my $queue = '';  if ($queue eq "" ...

Since that's *always* true, no matter how many printers are defined, or how many Koha's live on the same box, the best they will do is all print to the same /tmp file.  Also printreserve has the same defects.

But wait, it gets better.  Here's the content of that file:

atz@arwen:~/koha/production/koha$ cat /tmp/kohaiss 
Horowhenua Library Trust
Phone: 368-1953
Fax:    367-9218
Email:  renewals@library.org.nz


23529001000463
  Acosta
0 Coping with venereal disease /
502326000056               00/02/0
===================================

Hardcoded HLT, mangled date handling, etc.  So the code as is can't work for anybody, even HLT, since it doesn't actually send to printer.   



---- Additional Comments From nengard@gmail.com 2008-05-31 04:47:34 ----

I'm okay with anything - just let me know what to do with the documentation - I already added a page for this.



---- Additional Comments From chris@bigballofwax.co.nz 2008-06-01 13:27:20 ----

Well I can guarantee that HLT, Kapiti, Opus and RDL print slips over the network using CUPS and Koha everyday. HLT has been since jan 3 2000 .. so the code sure as heck used to work. 

http://cvs.savannah.gnu.org/viewvc/koha/C4/Print.pm?root=koha&r1=1.20&r2=1.21

So it got broken april 2007. So will work in all the 2.2 series, which is why it works for the above libraries, but is busted for 3.

If I get a chance this week ill patch it



---- Additional Comments From jmf@liblime.com 2008-06-16 12:15:30 ----

Sorry Chris, but I don't buy it. Here is the code in 2.2.9:

http://cvs.savannah.gnu.org/viewvc/koha/C4/Print.pm?revision=1.17&root=koha&view=markup&pathrev=R_2-2-9

  print PRINTER "Horowhenua Library Trust\r\n";
#  print PRINTER "$brdata->{'branchname'}\r\n";
  print PRINTER "Phone: 368-1953\r\n";
  print PRINTER "Fax:    367-9218\r\n";
  print PRINTER "Email:  renewals\@library.org.nz\r\n\r\n\r\n";
  print PRINTER "$borrower->{'cardnumber'}\r\n";
  print PRINTER "$borrower->{'title'} $borrower->{'initials'} $borrower->{'surname'}\r\n";


My conclusion is that it's never worked in stock Koha, and that the code was customized for NZ libraries that use it--on an individual basis (ie, each library that uses it has a custom version of Printer.pm.

I was under the mistaken impression that it was in a usable state before recommending it be left in ... I'd be fine with removing it for 3.0, and if a library really needs it, they can sponsor it's creation in a way that works for the community.



---- Additional Comments From paul.poulain@biblibre.com 2008-06-17 09:55:06 ----

I agree with joshua comment : when I teach Koha I says this option is useless & works only for some NZ libraries (that's not a problem, as I don't have any library printing slips on every user issue. and french libraries don't worry when there is a link that "does nothing")

cheers



---- Additional Comments From jmf@liblime.com 2008-06-20 14:42:04 ----

I've commented out the link ... someone who has a generalized version of this feature working that can be used in non-NZ libraries is welcome to submit that code at any time :-) In the meantime, I'm marking as FIXED.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:37 UTC  ---

This bug was previously known as _bug_ 2045 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2045

Actual time not defined. Setting to 0.0