Bugzilla – Attachment 9947 Details for
Bug 7915
Print a barcoded membership card from member detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for printing the barcoded membership card
0001-Print-a-barcoded-membership-card-from-member-detail-.patch (text/plain), 5.22 KB, created by
Ebin Joseph
on 2012-06-06 11:51:03 UTC
(
hide
)
Description:
Patch for printing the barcoded membership card
Filename:
MIME Type:
Creator:
Ebin Joseph
Created:
2012-06-06 11:51:03 UTC
Size:
5.22 KB
patch
obsolete
>From 2de716eafef8312fb481b60a272890cb9681e659 Mon Sep 17 00:00:00 2001 >From: Ebin Joseph <ebin.joseph@osslabs.biz> >Date: Wed, 6 Jun 2012 16:13:29 +0530 >Subject: [PATCH] Print a barcoded membership card from member detail page > >--- > koha-tmpl/intranet-tmpl/prog/en/css/screen.css | 64 ++++++++++++++++++++ > .../prog/en/includes/members-toolbar.inc | 1 + > .../prog/en/modules/members/patroncard-print.tt | 33 ++++++++++ > members/moremember.pl | 3 + > members/patronprintbarcode.pl | 28 +++++++++ > 5 files changed, 129 insertions(+), 0 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/css/screen.css > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/patroncard-print.tt > create mode 100755 members/patronprintbarcode.pl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/screen.css b/koha-tmpl/intranet-tmpl/prog/en/css/screen.css >new file mode 100644 >index 0000000..c110ffa >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/screen.css >@@ -0,0 +1,64 @@ >+body { >+width: 320px; >+height: 195px; >+padding: 0 0 0 0; >+margin: 0 0 0 0; >+font-family: serif; >+font-size: 0.9em; >+} >+ >+@page { >+margin: 0.1cm; >+width: 320px; >+height: 210px; >+} >+ >+#front { >+width: 300px; >+height: 195px; >+position: relative; >+border-style: dotted; >+border-width: 1px; >+} >+ >+#picture { >+margin: 5px; >+position: absolute; >+top: 33px; >+margin-left: 10px; >+} >+ >+#image { >+max-height: 100px; >+max-width: 80px; >+} >+ >+#barcodes { >+margin: 2px 0 5px 15px; >+position: absolute; >+top: 140px; >+} >+ >+#cardnumber { >+max-height: 50px; >+max-width: 192px; >+} >+ >+#contents { >+left: 100px; >+position: absolute; >+top: 39px; >+} >+ >+#branchnames { >+position: relative; >+} >+ >+#branch { >+margin: 7px 0 0 2px; >+} >+ >+p.content { >+margin: 0 0 1px 1px; >+} >+ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 1b4c22d..ee453c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -54,6 +54,7 @@ function update_child() { > var printmenu = [ > { text: _("Print summary"), onclick: {fn: function(){printx_window("page")}} }, > { text: _("Print slip"), onclick: {fn: function(){printx_window("slip")}} }, >+ { text: _("Print Card(s)"), onclick: {fn: function(){printx_window("card")}} }, > { text: _("Print quick slip"), onclick: {fn: function(){printx_window("qslip")}} } > ]; > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/patroncard-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/patroncard-print.tt >new file mode 100644 >index 0000000..0595516 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/patroncard-print.tt >@@ -0,0 +1,33 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Patron Card [% firstname %] [% surname %] ([% cardnumber %])</title><head> >+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >+ >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/screen.css"/> >+<!--<link rel="stylesheet" type="text/css" href="[% themelang %]/css/output.css" media="print"/> --> >+</head> >+ >+<body> >+ >+<div id="front"> >+ <div id="branchnames"> >+ <p id="branch"><b>[%branchname%]</b></p> >+ </div> >+ >+ <div id="picture"> >+ [% IF ( picture ) %] >+ <img id="image" src="/cgi-bin/koha/members/patronimage.pl?crdnum=[% cardnumber %]&type=photo"id="patronimage" alt="[% firstname %] [% surname %] ([% cardnumber %])""> >+ [% END %] >+ </div> >+ >+ <div id="barcodes"> >+ <img id="cardnumber" src="/cgi-bin/koha/members/patronprintbarcode.pl?crdnum=[%cardnumber%]"> >+ </div> >+ >+ <div id="contents"> >+ <p class="content">Name: [%title%] [%firstname%] [%surname%]</p> >+ <p class="content">Membership No: [%cardnumber%]</p> >+ <p class="content">Category: [%description%]</p> >+ <p class="content">Valid Until: [%dateexpiry%]</p> >+ </div> >+ >+</div> >diff --git a/members/moremember.pl b/members/moremember.pl >index cc9afb9..11f3afb 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -98,6 +98,9 @@ if ($print eq "page") { > } elsif ($print eq "brief") { > $template_name = "members/moremember-brief.tmpl"; > $flagsrequired = { borrowers => 1 }; >+} elsif ($print eq "card") { >+ $template_name = "members/patroncard-print.tmpl"; >+ $flagsrequired = { circulate => "circulate_remaining_permissions" }; > } else { > $template_name = "members/moremember.tmpl"; > $flagsrequired = { borrowers => 1 }; >diff --git a/members/patronprintbarcode.pl b/members/patronprintbarcode.pl >new file mode 100755 >index 0000000..857a8eb >--- /dev/null >+++ b/members/patronprintbarcode.pl >@@ -0,0 +1,28 @@ >+#!/usr/bin/perl >+ >+use strict; >+use CGI; #qw(:standard escapeHTML); >+use C4::Context; >+use C4::Members; >+use GD::Barcode::Code39; >+$|=1; >+ >+my $DEBUG = 0; >+my $data = new CGI; >+my $cardnumber; >+ >+ >+if ($data->param('crdnum')) { >+ $cardnumber = $data->param('crdnum'); >+} else { >+ $cardnumber = shift; >+} >+ >+ >+warn "Cardnumber passed in: $cardnumber" if $DEBUG; >+ >+ binmode(STDOUT); >+ print "Content-Type: image/png\n\n"; >+ print GD::Barcode::Code39->new("*$cardnumber*")->plot->png; >+ >+ >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7915
: 9947