Bugzilla – Attachment 29613 Details for
Bug 6815
Capture member photo via webcam
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Readable, but not useable attachment
stupid.txt (text/plain), 29.41 KB, created by
Mark Tompsett
on 2014-07-10 15:15:17 UTC
(
hide
)
Description:
Readable, but not useable attachment
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2014-07-10 15:15:17 UTC
Size:
29.41 KB
patch
obsolete
>Patron Image Capture via Webcam >Instead of uploading a file, capture the image directly from a webcam >--- > .../prog/en/includes/circ-toolbar.inc | 2 + > .../prog/en/includes/members-toolbar.inc | 2 + > .../prog/en/modules/members/member-captureimage.tt | 557 ++++++++++++++++++++ > .../intranet-tmpl/prog/img/jscam_canvas_only.swf | Bin 0 -> 1546 bytes > members/member-captureimage.pl | 79 +++ > tools/picture-image-upload.pl | 60 +++ > 6 files changed, 700 insertions(+), 0 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/member-captureimage.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/img/jscam_canvas_only.swf > create mode 100755 members/member-captureimage.pl > create mode 100755 tools/picture-image-upload.pl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc >index 503f954..8bbfa05 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc >@@ -102,6 +102,7 @@ function update_child() { > new YAHOO.widget.Button("duplicate"); > new YAHOO.widget.Button("printslip"); > new YAHOO.widget.Button("printpage"); >+ new YAHOO.widget.Button("captureimage"); > new YAHOO.widget.Button("renewpatron"); > [% IF ( CAN_user_permissions ) %] > [% IF ( StaffMember ) %] >@@ -139,6 +140,7 @@ function update_child() { > [% IF ( StaffMember ) %][% IF ( CAN_user_staffaccess ) %] <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change Password</a></li>[% END %] > [% ELSE %] <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change Password</a></li>[% END %] > [% END %] >+ [% IF ( patronimages ) %] <li><a id="captureimage" href="/cgi-bin/koha/members/member-captureimage.pl?borrowernumber=[% borrowernumber %]">Capture Image</a></li>[% END %] > <li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]">Duplicate</a></li> > <li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=page">Print Page</a></li> > <li><a id="printslip" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=slip">Print Slip</a></li> >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 afad863..f5b0748 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -92,6 +92,7 @@ function update_child() { > new YAHOO.widget.Button("editpatron"); > new YAHOO.widget.Button("addnote"); > new YAHOO.widget.Button("changepassword"); >+ new YAHOO.widget.Button("captureimage"); > new YAHOO.widget.Button("duplicate"); > new YAHOO.widget.Button("printslip"); > new YAHOO.widget.Button("printpage"); >@@ -120,6 +121,7 @@ function update_child() { > [% END %] > [% IF ( adultborrower ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C">Add child</a></li>[% END %] > <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change Password</a></li> >+ [% IF ( patronimages ) %] <li><a id="captureimage" href="/cgi-bin/koha/members/member-captureimage.pl?borrowernumber=[% borrowernumber %]">Capture Image</a></li>[% END %] > <li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]">Duplicate</a></li> > <li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=page">Print Page</a></li> > <li><a id="printslip" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=slip">Print Slip</a></li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-captureimage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-captureimage.tt >new file mode 100644 >index 0000000..7d0e7cb >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-captureimage.tt >@@ -0,0 +1,557 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Patrons › Capture Photo and Signature for [% surname %], [% firstname %]</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> >+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> >+<script type="text/JavaScript" language="JavaScript"> >+//<![CDATA[ >+$.tablesorter.addParser({ >+ id: 'articles', >+ is: function(s) {return false; }, >+ format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, >+ type: 'text' >+}); >+$(document).ready(function() { >+ $('#finesholdsissues > ul').tabs(); >+ $.tablesorter.defaults.widgets = ['zebra']; >+ $("#issuest").tablesorter({[% IF ( dateformat_metric ) %] >+ dateFormat: 'uk',[% END %] >+ headers: { 1: { sorter: 'articles' }} >+ }); >+ $("#relissuest").tablesorter({[% IF ( dateformat_metric ) %] >+ dateFormat: 'uk',[% END %] >+ headers: { 1: { sorter: 'articles' }} >+ }); >+ $("#holdst").tablesorter({[% IF ( dateformat_metric ) %] >+ dateFormat: 'uk',[% END %] >+ sortList: [[0,0]], >+ headers: { 1: { sorter: 'articles' },6: { sorter: false }} >+ }); >+ [% IF ( picture ) %] >+ // new YAHOO.widget.Button("delpicture"); // FIXME: formatting mismatch between YUI and normal button >+ $('#delpicture').click(function(){ >+ return confirm(_('Are you sure you want to delete this patron image? This cannot be undone.')); >+ }); >+ $('#manage-patron-image').find("input[value*=Upload]").click(function(){ >+ if($("#uploadfile").val() == ""){ >+ alert(_("Please choose a file to upload")); >+ return false; >+ } >+ return confirm(_('Are you sure you want to replace the current patron image? This cannot be undone.')); >+ });[% END %] >+ $("td").click(function(e){ >+ if(e.target.tagName.toLowerCase() == 'td'){ >+ $(this).find("input:checkbox").each( function() { >+ $(this).attr('checked', !$(this).attr('checked')); >+ if($(this).attr('checked')){ >+ $(this).parent().siblings().find("input:checkbox").each(function(){ >+ if($(this).attr('checked')){ $(this).attr('checked',''); } >+ }); >+ } >+ }); >+ } >+ }); >+ }); >+ >+//]]> >+</script> >+<script type="text/javascript"> >+function displayimage() >+{ >+var canvasData=document.getElementById("doodle_canvas").toDataurl("image/png"); >+var imageurl = canvasData.replace(/^data:image\/(png|jpg);base64,/, ""); >+document.getElementById("dataurlphoto").value=imageurl; >+ >+} >+</script> >+ >+</head> >+<body> >+ >+ >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'patron-search.inc' %] >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% firstname %] [% surname %]</a> › [% IF ( newpassword ) %]Password Updated[% ELSE %]Change Username and/or Password[% END %]</div> >+ >+<div id="doc3" class="yui-t2"> >+ >+ >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+[% INCLUDE 'members-toolbar.inc' %] >+ >+ >+ >+<style type="text/css"> >+ >+#webcam, #doodle_canvas { >+ width: 320px; >+ border:20px solid #333; >+ background:#eee; >+ -webkit-border-radius: 20px; >+ -moz-border-radius: 20px; >+ border-radius: 20px; >+} >+ >+#webcam { >+ position:relative; >+ margin-top:50px; >+ margin-bottom:50px; >+} >+ >+#webcam > span { >+ z-index:2; >+ position:absolute; >+ color:#eee; >+ font-size:10px; >+ bottom: -16px; >+ left:152px; >+} >+ >+#webcam > img { >+ z-index:1; >+ position:absolute; >+ border:0px none; >+ padding:0px; >+ bottom:-40px; >+ left:89px; >+} >+ >+#webcam > div { >+ border:5px solid #333; >+ position:absolute; >+ right:-90px; >+ padding:5px; >+ -webkit-border-radius: 8px; >+ -moz-border-radius: 8px; >+ border-radius: 8px; >+ cursor:pointer; >+} >+ >+#webcam a { >+ background:#fff; >+ font-weight:bold; >+} >+ >+#webcam a > img { >+ border:0px none; >+} >+ >+#doodle_canvas { >+ border:20px solid #ccc; >+ background:#eee; >+ position:relative; >+ left:380px; >+ top:-330px; >+ display:none; >+} >+ >+#canvas_wrapper { >+ padding: 0; >+ position:relative; >+ height:0px; >+} >+ >+#controls DIV:active { >+ margin-top: 1px; >+ margin-left: 1px; >+} >+ >+#controls DIV { >+ padding: 2px 10px; >+ padding-left: 30px; >+ margin-right: 5px; >+ background-position: left top; >+ background-repeat: no-repeat; >+ cursor: pointer; >+} >+#controls .active { >+ background-color: #FF9; >+} >+ >+ >+#flash { >+ position:absolute; >+ top:0px; >+ left:0px; >+ z-index:5000; >+ width:100%; >+ height:500px; >+ background-color:#c00; >+ display:none; >+} >+#controls { >+ /*overflow: hidden;*/ >+ margin-bottom: 10px; >+ width: 10px; >+ margin: 0 auto; >+ position:relative; >+ bottom:300px; >+} >+ >+ >+object { >+ display:block; /* html5 fix */ >+ position:relative; >+ z-index:1000; >+} >+ >+</style> >+ >+ >+<script type="text/javascript"> >+ >+(function ($) { >+ >+ var webcam = { >+ >+ extern: null, // external select token to support jQuery dialogs >+ append: true, // append object instead of overwriting >+ >+ width: 320, >+ height: 240, >+ >+ mode: "callback", // callback | save | stream >+ >+ swffile: "jscam.swf", >+ quality: 100, >+ >+ debug: function () {}, >+ onCapture: function () {}, >+ onTick: function () {}, >+ onSave: function () {}, >+ onLoad: function () {} >+ }; >+ >+ window.webcam = webcam; >+ >+ $.fn.webcam = function(options) { >+ >+ if (typeof options === "object") { >+ for (var ndx in webcam) { >+ if (options[ndx] !== undefined) { >+ webcam[ndx] = options[ndx]; >+ } >+ } >+ } >+ >+ var source = '<object id="XwebcamXobjectX" type="application/x-shockwave-flash" data="'+webcam.swffile+'" width="'+webcam.width+'" height="'+webcam.height+'"><param name="movie" value="'+webcam.swffile+'" /><param name="FlashVars" value="mode='+webcam.mode+'&quality='+webcam.quality+'" /></object>'; >+ >+ if (null !== webcam.extern) { >+ $(webcam.extern)[webcam.append ? "append" : "html"](source); >+ } else { >+ this[webcam.append ? "append" : "html"](source); >+ } >+ >+ (_register = function(run) { >+ >+ var cam = document.getElementById('XwebcamXobjectX'); >+ >+ if (cam.capture !== undefined) { >+ >+ /* Simple callback methods are not allowed :-/ */ >+ webcam.capture = function(x) { >+ try { >+ return cam.capture(x); >+ } catch(e) {} >+ } >+ webcam.save = function(x) { >+ try { >+ return cam.save(x); >+ } catch(e) {} >+ } >+ webcam.setCamera = function(x) { >+ try { >+ return cam.setCamera(x); >+ } catch(e) {} >+ } >+ webcam.getCameraList = function() { >+ try { >+ return cam.getCameraList(); >+ } catch(e) {} >+ } >+ >+ webcam.onLoad(); >+ } else if (0 == run) { >+ webcam.debug("error", "Flash movie not yet registered!"); >+ } else { >+ /* Flash interface not ready yet */ >+ window.setTimeout(_register, 1000 * (4 - run), run - 1); >+ } >+ })(3); >+ } >+ >+})(jQuery); >+ >+</script> >+</head> >+<body> >+<p id="status" style="height:22px; color:#c00;font-weight:bold;"></p> >+<div id="webcam"> </div> >+<canvas id="doodle_canvas" height="240" width="320"></canvas> >+<div id="manage-patron-image"> >+[% IF ( patronimages ) %] >+ [% IF ( CAN_user_tools_batch_upload_patron_images ) %] >+ <form method="post" action="/cgi-bin/koha/tools/picture-image-upload.pl" enctype="multipart/form-data" onsubmit="webcam.capture();displayimage();"> >+ >+ <input type="hidden" id="image" name="filetype" value="image" /> >+ <input type="hidden" id="cardnumber" name="cardnumber" value="[% cardnumber %]" /> >+ <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ <input id="dataurlphoto" name="dataurlphoto" type="hidden" /> >+ <fieldset class="action"> >+ <input type="submit" value="Upload_Image" class="submit"/> >+ <input name="op" type="hidden" value="Upload" /> >+ [% IF ( picture ) %]<a id="delpicture" href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&cardnumber=[% cardnumber %]&borrowernumber=[% borrowernumber %]" class="delete">Delete</a>[% END %] >+ </fieldset> >+ </fieldset> >+ </form> >+ [% END %] >+[% END %] >+</div> >+ >+<script type="text/javascript"> >+ >+var pos = 0; >+var ctx = null; >+var cam = null; >+var image = null; >+ >+var filter_on = false; >+var filter_id = 0; >+ >+function changeFilter() { >+ if (filter_on) { >+ filter_id = (filter_id + 1) & 7; >+ } >+} >+ >+function toggleFilter(obj) { >+ if (filter_on =!filter_on) { >+ obj.parentNode.style.borderColor = "#c00"; >+ } else { >+ obj.parentNode.style.borderColor = "#333"; >+ } >+} >+ >+jQuery("#webcam").webcam({ >+ >+ width: 320, >+ height: 240, >+ mode: "callback", >+ swffile: "/intranet-tmpl/prog/img/jscam_canvas_only.swf", >+ >+ onTick: function(remain) { >+ >+ if (0 == remain) { >+ jQuery("#status").text("Cheeseexclamation"); >+ } else { >+ jQuery("#status").text(remain + " seconds remaining..."); >+ } >+ }, >+ >+ onSave: function(data) { >+ >+ var col = data.split(";"); >+ var img = image; >+ >+ if (false == filter_on) { >+ >+ for(var i = 0; i < 320; i++) { >+ var tmp = parseInt(col[i]); >+ img.data[pos + 0] = (tmp >> 16) & 0xff; >+ img.data[pos + 1] = (tmp >> 8) & 0xff; >+ img.data[pos + 2] = tmp & 0xff; >+ img.data[pos + 3] = 0xff; >+ pos+= 4; >+ } >+ >+ } else { >+ >+ var id = filter_id; >+ var r,g,b; >+ var r1 = Math.floor(Math.random() * 255); >+ var r2 = Math.floor(Math.random() * 255); >+ var r3 = Math.floor(Math.random() * 255); >+ >+ for(var i = 0; i < 320; i++) { >+ var tmp = parseInt(col[i]); >+ >+ /* Copied some xcolor methods here to be faster than calling all methods inside of xcolor and to not serve complete library with every req */ >+ >+ if (id == 0) { >+ r = (tmp >> 16) & 0xff; >+ g = 0xff; >+ b = 0xff; >+ } else if (id == 1) { >+ r = 0xff; >+ g = (tmp >> 8) & 0xff; >+ b = 0xff; >+ } else if (id == 2) { >+ r = 0xff; >+ g = 0xff; >+ b = tmp & 0xff; >+ } else if (id == 3) { >+ r = 0xff ^ ((tmp >> 16) & 0xff); >+ g = 0xff ^ ((tmp >> 8) & 0xff); >+ b = 0xff ^ (tmp & 0xff); >+ } else if (id == 4) { >+ >+ r = (tmp >> 16) & 0xff; >+ g = (tmp >> 8) & 0xff; >+ b = tmp & 0xff; >+ var v = Math.min(Math.floor(.35 + 13 * (r + g + b) / 60), 255); >+ r = v; >+ g = v; >+ b = v; >+ } else if (id == 5) { >+ r = (tmp >> 16) & 0xff; >+ g = (tmp >> 8) & 0xff; >+ b = tmp & 0xff; >+ if ((r+= 32) < 0) r = 0; >+ if ((g+= 32) < 0) g = 0; >+ if ((b+= 32) < 0) b = 0; >+ } else if (id == 6) { >+ r = (tmp >> 16) & 0xff; >+ g = (tmp >> 8) & 0xff; >+ b = tmp & 0xff; >+ if ((r-= 32) < 0) r = 0; >+ if ((g-= 32) < 0) g = 0; >+ if ((b-= 32) < 0) b = 0; >+ } else if (id == 7) { >+ r = (tmp >> 16) & 0xff; >+ g = (tmp >> 8) & 0xff; >+ b = tmp & 0xff; >+ r = Math.floor(r / 255 * r1); >+ g = Math.floor(g / 255 * r2); >+ b = Math.floor(b / 255 * r3); >+ } >+ >+ img.data[pos + 0] = r; >+ img.data[pos + 1] = g; >+ img.data[pos + 2] = b; >+ img.data[pos + 3] = 0xff; >+ pos+= 4; >+ } >+ } >+ >+ if (pos >= 0x4B000) { >+ ctx.putImageData(img, 0, 0); >+ pos = 0; >+ } >+ }, >+ >+ onCapture: function () { >+ webcam.save(); >+ >+ jQuery("#flash").css("display", "block"); >+ jQuery("#flash").fadeOut(100, function () { >+ jQuery("#flash").css("opacity", 1); >+ }); >+ }, >+ >+ debug: function (type, string) { >+ jQuery("#status").html(type + ": " + string); >+ }, >+ >+ onLoad: function () { >+ >+ var cams = webcam.getCameraList(); >+ for(var i in cams) { >+ jQuery("#cams").append("<li>" + cams[i] + "</li>"); >+ } >+ } >+}); >+ >+function getPageSize() { >+ >+ var xScroll, yScroll; >+ >+ if (window.innerHeight && window.scrollMaxY) { >+ xScroll = window.innerWidth + window.scrollMaxX; >+ yScroll = window.innerHeight + window.scrollMaxY; >+ } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac >+ xScroll = document.body.scrollWidth; >+ yScroll = document.body.scrollHeight; >+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari >+ xScroll = document.body.offsetWidth; >+ yScroll = document.body.offsetHeight; >+ } >+ >+ var windowWidth, windowHeight; >+ >+ if (self.innerHeight) { // all except Explorer >+ if(document.documentElement.clientWidth){ >+ windowWidth = document.documentElement.clientWidth; >+ } else { >+ windowWidth = self.innerWidth; >+ } >+ windowHeight = self.innerHeight; >+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode >+ windowWidth = document.documentElement.clientWidth; >+ windowHeight = document.documentElement.clientHeight; >+ } else if (document.body) { // other Explorers >+ windowWidth = document.body.clientWidth; >+ windowHeight = document.body.clientHeight; >+ } >+ >+ // for small pages with total height less then height of the viewport >+ if(yScroll < windowHeight){ >+ pageHeight = windowHeight; >+ } else { >+ pageHeight = yScroll; >+ } >+ >+ // for small pages with total width less then width of the viewport >+ if(xScroll < windowWidth){ >+ pageWidth = xScroll; >+ } else { >+ pageWidth = windowWidth; >+ } >+ >+ return [pageWidth, pageHeight]; >+} >+ >+window.addEventListener("load", function() { >+ >+ jQuery("body").append("<div id=\"flash\"></div>"); >+ >+ var canvas = document.getElementById("doodle_canvas"); >+ >+ if (canvas.getContext) { >+ ctx = document.getElementById("doodle_canvas").getContext("2d"); >+ ctx.clearRect(0, 0, 320, 240); >+ >+ var img = new Image(); >+ //img.src = "/intranet-tmpl/prog/img/patron-blank.png"; >+ img.onload = function() { >+ ctx.drawImage(img, 129, 89); >+ } >+ image = ctx.getImageData(0, 0, 320, 240); >+ } >+ >+ var pageSize = getPageSize(); >+ jQuery("#flash").css({ height: pageSize[1] + "px" }); >+ >+}, false); >+ >+window.addEventListener("resize", function() { >+ >+ var pageSize = getPageSize(); >+ jQuery("#flash").css({ height: pageSize[1] + "px" }); >+ >+}, false); >+ >+</script> >+ >+ >+</div> >+</div> >+ >+<div class="yui-b"> >+[% INCLUDE 'circ-menu.inc' %] >+</div> >+</div> >+[% INCLUDE 'intranet-bottom.inc' %] >+ >diff --git a/koha-tmpl/intranet-tmpl/prog/img/jscam_canvas_only.swf b/koha-tmpl/intranet-tmpl/prog/img/jscam_canvas_only.swf >new file mode 100644 >index 0000000000000000000000000000000000000000..c785648599c37fef6952802007473b853bb188e3 >GIT binary patch >literal 1546 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 > >literal 0 >HcmV?d00001 > >diff --git a/members/member-captureimage.pl b/members/member-captureimage.pl >new file mode 100755 >index 0000000..051be4b >--- /dev/null >+++ b/members/member-captureimage.pl >@@ -0,0 +1,79 @@ >+#!/usr/bin/perl >+ >+# Copyright 2011 Nucsoft Osslabs >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+ >+use strict; >+use warnings; >+ >+use C4::Auth; >+use C4::Output; >+use C4::Context; >+use C4::Members; >+use C4::Branch; >+use CGI; >+ >+use Digest::MD5 qw(md5_base64); >+ >+my $input = new CGI; >+ >+my $theme = $input->param('theme') || "default"; >+ >+my ($template, $loggedinuser, $cookie, $staffflags) >+ = get_template_and_user({template_name => "members/member-captureimage.tmpl", >+ query => $input, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => {borrowers => 1}, >+ debug => 1, >+ }); >+ >+my $flagsrequired; >+$flagsrequired->{borrowers}=1; >+ >+my $borrowernumber=$input->param('borrowernumber'); >+my $cardnumber = $input->param('cardnumber'); >+my $destination = $input->param('destination'); >+my $errormsg; >+my ($bor)=GetMember('borrowernumber' => $borrowernumber); >+my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'}); >+$template->param( picture => 1 ) if $picture; >+$template->param( >+ borrowernumber => $borrowernumber, >+ othernames => $bor->{'othernames'}, >+ surname => $bor->{'surname'}, >+ firstname => $bor->{'firstname'}, >+ cardnumber => $bor->{'cardnumber'}, >+ categorycode => $bor->{'categorycode'}, >+ category_type => $bor->{'category_type'}, >+ categoryname => $bor->{'description'}, >+ address => $bor->{'address'}, >+ address2 => $bor->{'address2'}, >+ city => $bor->{'city'}, >+ zipcode => $bor->{'zipcode'}, >+ country => $bor->{'country'}, >+ phone => $bor->{'phone'}, >+ email => $bor->{'email'}, >+ branchcode => $bor->{'branchcode'}, >+ branchname => GetBranchName($bor->{'branchcode'}), >+ userid => $bor->{'userid'}, >+ destination => $destination, >+ >+ ); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/tools/picture-image-upload.pl b/tools/picture-image-upload.pl >new file mode 100755 >index 0000000..da63270 >--- /dev/null >+++ b/tools/picture-image-upload.pl >@@ -0,0 +1,60 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# Copyright 2011 Nucsoft osslabs >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along with >+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, >+# Suite 330, Boston, MA 02111-1307 USA >+ >+#use strict; >+ >+use File::Temp; >+use File::Copy; >+use CGI; >+use GD; >+use C4::Context; >+use C4::Auth; >+use C4::Output; >+use C4::Members; >+use C4::Debug; >+use MIME::Base64; >+ >+my $input = new CGI; >+ >+my $filetype = $input->param('filetype'); >+my $cardnumber = $input->param('cardnumber'); >+my $borrowernumber = $input->param('borrowernumber'); >+my $op = $input->param('op'); >+my $dataurlphoto = $input->param('dataurlphoto'); >+my $dataurlsign = $input->param('dataurlsign'); >+my $image = decode_base64($dataurlphoto); >+ >+$debug and warn "Params are: cardnumber=$cardnumber, borrowernumber=$borrowernumber, image=$image"; >+ >+ my $mimetype = 'image/png'; >+ my $dberror = PutPatronImage($cardnumber,$mimetype, $image, $op) if $mimetype; >+ >+ if ( $dberror ) { >+ warn "Database returned error: $dberror"; >+ ($dberror =~ /patronimage_fk1/) ? $filerrors{'IMGEXISTS'} = 1 : $filerrors{'DBERR'} = 1; >+ push my @filerrors, \%filerrors; >+ push @{ $count{filenames} }, { filerrors => \@filerrors, image => $image, cardnumber => $cardnumber }; >+ $template->param( ERRORS => 1 ); >+ } >+ >+if ( $borrowernumber) { >+ print $input->redirect ("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); >+} else { >+ output_html_with_http_headers $input, $cookie, $template->output; >+} >+ > >
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 Raw
Actions:
View
Attachments on
bug 6815
:
22623
|
29613
|
38518
|
91302
|
91303
|
91335
|
99015
|
99016
|
99757
|
106774
|
106775
|
106776
|
106777
|
106782
|
106783
|
106787
|
106788
|
106789
|
106790
|
106791
|
106792
|
106793
|
106794
|
106795
|
106796
|
106797
|
106798
|
106799
|
106800
|
106801
|
106802
|
106803
|
106804
|
106938
|
106939
|
106940
|
131174
|
131554
|
131985
|
131987
|
131988
|
131999
|
132000
|
132001