Kumara - predecessor to Koha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
4.2 KiB

  1. #!/usr/bin/perl
  2. use strict;
  3. #use C4::Security;
  4. #use C4::Database;
  5. use C4::Circulation::Main;
  6. #use C4::Circulation::Issues;
  7. #use C4::Circulation::Returns;
  8. #use C4::Circulation::Renewals;
  9. #use C4::Circulation::Borrower;
  10. #use C4::Reserves;
  11. use C4::InterfaceCDK;
  12. #use C4::Security;
  13. # set up environment array
  14. # branchcode - logged on branch
  15. # usercode - current user
  16. # proccode - current or last procedure
  17. # borrowernumber - current or last borrowernumber
  18. # logintime - time logged on
  19. # lasttime - lastime security checked
  20. # tempuser - temporary user
  21. my %env = (
  22. branchcode => "", usercode => "", proccode => "lgon", borrowernumber => "",
  23. logintime => "", lasttime => "", tempuser => "", debug => "9"
  24. );
  25. $env{'branchcode'} = "C";
  26. $env{'usercode'} = `whoami`;
  27. $env{'telnet'} = "Y";
  28. #start interface
  29. &startint(\%env,'Circulation');
  30. getbranch(\%env);
  31. getprinter(\%env);
  32. my $donext = 'Circ';
  33. my $reason;
  34. my $data;
  35. while ($donext ne 'Quit') {
  36. if ($donext eq "Circ") {
  37. ($reason,$data) = menu(\%env,'console','Circulation',
  38. ('Issues','Returns','Select Branch','Select Printer'));
  39. } else {
  40. $data = $donext;
  41. }
  42. if ($data eq 'Issues') {
  43. my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}","$env{'brdata'}","$env{'lasttime'}");
  44. open (FILE,">>/tmp/$<_$$");
  45. my $time=localtime(time);
  46. print FILE "Start issues $time \n";
  47. close FILE;
  48. system(@args);
  49. } elsif ($data eq 'Returns') {
  50. my @args=('returnswrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}","$env{'brdata'}");
  51. open (FILE,">>/tmp/$<_$$");
  52. my $time=localtime(time);
  53. print FILE "Start returns $time \n";
  54. close FILE;
  55. system(@args);
  56. # $donext=Returns(\%env); #C4::Circulation::Returns
  57. } elsif ($data eq 'Select Branch') {
  58. getbranch(\%env);
  59. } elsif ($data eq 'Select Printer') {
  60. getprinter(\%env);
  61. # } elsif ($data eq 'Borrower Enquiries') {
  62. # $donext=Borenq($env); #C4::Circulation::Borrower - conversion
  63. # } elsif ($data eq 'Reserves'){
  64. # $donext=EnterReserves(\%env); #C4::Reserves
  65. } elsif ($data eq 'Quit') {
  66. $donext = $data;
  67. &endint(\%env);
  68. die;
  69. }
  70. }
  71. &endint(\%env);
  72. die;