Skip to content
Newer
Older
100755 70 lines (55 sloc) 2.28 KB
a0b06fb @ctfliblime Prepare for perlbrew usage by changing all script magic to "#!/usr/bi…
ctfliblime authored
1 #!/usr/bin/env perl
29365ca Clubs & Services
PTFS authored
2
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
8 # version.
9 #
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA 02111-1307 USA
17
18
19 use strict;
20
21 use CGI;
22
23 use C4::Auth;
24 use C4::Koha;
25 use C4::Circulation;
26 use C4::Reserves;
27 use C4::Members;
28 use C4::Output;
29 use C4::Biblio;
30 use C4::Items;
31 use C4::Dates qw/format_date/;
32 use C4::Letters;
33 use C4::Branch; # GetBranches
34 use C4::ClubsAndServices;
35
36 my $query = new CGI;
37
38 my ($template, $borrowernumber, $cookie)
39 = get_template_and_user({template_name => "opac-clubsAndServices.tmpl",
40 query => $query,
41 type => "opac",
42 authnotrequired => 0,
43 flagsrequired => {borrow => 1},
44 debug => 1,
45 });
46
47 # get borrower information ....
48 my ( $borr ) = GetMemberDetails( $borrowernumber );
49
50 $borr->{'dateenrolled'} = format_date( $borr->{'dateenrolled'} );
51 $borr->{'expiry'} = format_date( $borr->{'expiry'} );
52 $borr->{'dateofbirth'} = format_date( $borr->{'dateofbirth'} );
53 $borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} );
54
55 if ( $query->param('action') eq 'cancel' ) { ## Cancel the enrollment in the passed club or service
56 CancelClubOrServiceEnrollment( $query->param('caseId') );
57 }
58
59 ## Get the borrowers current clubs & services
60 my $enrolledClubsAndServices = GetEnrolledClubsAndServices( $borrowernumber );
61 $template->param( enrolledClubsAndServicesLoop => $enrolledClubsAndServices );
62
63 ## Get clubs & services the borrower can enroll in from the OPAC
64 my $enrollableClubsAndServices = GetPubliclyEnrollableClubsAndServices( $borrowernumber );
65 $template->param( enrollableClubsAndServicesLoop => $enrollableClubsAndServices );
66
67 $template->param( clubs_services => 1 );
68
69 output_html_with_http_headers $query, $cookie, $template->output;
Something went wrong with that request. Please try again.