updated release notes for 3.14.0 beta
[koha.git] / members / member-picupload.pl
old mode 100644 (file)
new mode 100755 (executable)
index f2927b6..75bbea4
@@ -1,6 +1,5 @@
 #!/usr/bin/perl
 
-# $Id$
 
 # script to upload a picture to a borrowerimages directory.
 # checks to see if its either displaying the upload form
 # 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
+# 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::Context;
 use C4::Output;
 use CGI;
-use HTML::Template;
-use C4::Interface::CGI::Output;
-use C4::Interface::CGI::Template;
+
 
 my $input = new CGI;
 my $name = $input->param('name');
-my $bornum = $input->param('bornum');
+my $borrowernumber = $input->param('borrowernumber');
 my $photo = $input->param('photo');
 
 my $template_name;
-my $upload_dir= 
 my $htdocs = C4::Context->config('intrahtdocs');
 my $upload_dir = $htdocs."/borrowerimages";
 if($photo eq  ""){
@@ -59,21 +57,21 @@ my ($template, $loggedinuser, $cookie)
                             });
 if ($photo){
 
-       my $filename=$bornum.'.jpg';
+       my $filename=$borrowernumber.'.jpg';
        my $upload_filehandle = $input->upload("photo");
-       open UPLOADFILE, ">$upload_dir/$filename";
-       binmode UPLOADFILE;
+    open (my $upload_fh, '>', "$upload_dir/$filename");
+    binmode $upload_fh;
        while ( <$upload_filehandle> )
        {
-               print UPLOADFILE;
+        print $upload_fh;
        }
-       close UPLOADFILE;
+    close $upload_fh;
 }
 else {
        $template->param(
-                bornum => $bornum,
+                borrowernumber => $borrowernumber,
                 name => $name
                 );
        output_html_with_http_headers $input, $cookie, $template->output;
 }
-print $input->redirect("http://intranet/cgi-bin/koha/members/moremember.pl?bornum=$bornum");
\ No newline at end of file
+print $input->redirect("http://intranet/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");