OPAC now show a systempref variable in main/home screen => easier to change for a...
[koha.git] / jmemberentry.pl
1 #!/usr/bin/perl
2
3 #script to set up screen for modification of borrower details
4 #written 20/12/99 by chris@katipo.co.nz
5
6
7 # Copyright 2000-2002 Katipo Communications
8 #
9 # This file is part of Koha.
10 #
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 #
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA  02111-1307 USA
23
24 use strict;
25 use C4::Auth;
26 use C4::Output;
27 use CGI;
28 use C4::Search;
29 use HTML::Template;
30 use C4::Interface::CGI::Output;
31 use C4::Date;
32 use C4::Members;
33
34 my $input = new CGI;
35
36 my ($template, $loggedinuser, $cookie)
37     = get_template_and_user({template_name => "members/jmemberentry.tmpl",
38                              query => $input,
39                              type => "intranet",
40                              authnotrequired => 0,
41                              flagsrequired => {borrowers => 1},
42                              debug => 1,
43                              });
44
45 my $member=$input->param('bornum');
46 if ($member eq ''){
47   $member=NewBorrowerNumber();
48 }
49 my $type=$input->param('type');
50
51 my $data=borrdata('',$member);
52
53 my @titles = ('Miss', 'Mrs', 'Ms', 'Mr', 'Dr', 'Sir');
54         # FIXME - Assumes English. This ought to be made part of i18n.
55 my @titledata;
56 while (@titles) {
57   my $title = shift @titles;
58   my %row = ('title' => $title);
59   if ($data->{'title'} eq $title) {
60     $row{'selected'}=' selected';
61   } else {
62     $row{'selected'}='';
63   }
64   push(@titledata, \%row);
65 }
66
67 # get the data for children
68 my $cmember1=NewBorrowerNumber();
69 my @cmemdata;
70 for (my $i=0;$i<1;$i++){
71   my %row;
72   $row{'cmember'}=$cmember1+$i;
73   $row{'i'}=$i;
74   $row{'count'}=$i+1;
75   push(@cmemdata, \%row);
76 }
77
78 my $jcardnumber=C4::Members::fixup_cardnumber("");
79
80 $template->param( member => $member,
81                         firstname       => $data->{'firstname'},
82                         surname         => $data->{'surname'},
83                         cardnumber      => $data->{'cardnumber'},
84                         jcardnumber     => $jcardnumber,
85                         area            => $data->{'area'},
86                         city            => $data->{'city'},
87                         physstreet         => $data->{'physstreet'},
88                         streetaddress   => $data->{'streetaddress'},
89                         streetcity      => $data->{'streetcity'},
90                         phone           => $data->{'phone'},
91                         phoneday        => $data->{'phoneday'},
92                         faxnumber       => $data->{'faxnumber'},
93                         emailaddress    => $data->{'emailaddress'},
94                         contactname     => $data->{'contactname'},
95                         altphone        => $data->{'altphone'},
96                         dateformat      => display_date_format(),
97                         titleloop       => \@titledata,
98                         cmemloop        => \@cmemdata );
99
100
101 output_html_with_http_headers $input, $cookie, $template->output;