koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha koha-tmpl/opac-tmpl/npl/en/opac-userdetail... [dev_week]


From: Kyle Hall
Subject: [Koha-cvs] koha koha-tmpl/opac-tmpl/npl/en/opac-userdetail... [dev_week]
Date: Wed, 31 Oct 2007 13:07:30 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Kyle Hall <kylemhall>   07/10/31 13:07:30

Modified files:
        koha-tmpl/opac-tmpl/npl/en: opac-userdetails.tmpl 
        opac           : opac-userdetails.pl 

Log message:
        Added choice of contact preferences for borrowers.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/npl/en/opac-userdetails.tmpl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.1.2.6&r2=1.1.2.1.2.7
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-userdetails.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.8.2.6.2.1&r2=1.8.2.6.2.2

Patches:
Index: koha-tmpl/opac-tmpl/npl/en/opac-userdetails.tmpl
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/opac-tmpl/npl/en/Attic/opac-userdetails.tmpl,v
retrieving revision 1.1.2.1.2.6
retrieving revision 1.1.2.1.2.7
diff -u -b -r1.1.2.1.2.6 -r1.1.2.1.2.7
--- koha-tmpl/opac-tmpl/npl/en/opac-userdetails.tmpl    30 Nov 2006 21:03:09 
-0000      1.1.2.1.2.6
+++ koha-tmpl/opac-tmpl/npl/en/opac-userdetails.tmpl    31 Oct 2007 13:07:29 
-0000      1.1.2.1.2.7
@@ -9,7 +9,6 @@
 <div id="main_wrapper">
 <div id="main">
 <div class="content-block">
-
 <h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR NAME="firstname" --> 
<!-- TMPL_VAR NAME="surname" -->'s account</a> <img src="<!-- TMPL_VAR 
NAME="themelang" -->/images/caret.gif" width="16" height="16" alt="&gt;" 
border="0" /> Personal Details</h3>
 
 <div class="form">
@@ -81,9 +80,37 @@
 
 </div>
 
-<form action="/cgi-bin/koha/opac-userupdate.pl" method="post">
-<input type="submit" name="Modify" value="Modify Your Record" class="submit" />
-</form>
+If any of this information is incorrect, please stop by the circulation desk 
to let us know of any changes.  For address or name changes, please bring photo 
ID 
+or a piece of mail with your current name and mailing address on it.  
+
+<!-- HIDE FOR CCFLS
+  <form action="/cgi-bin/koha/opac-userupdate.pl" method="post">
+  <input type="submit" name="Modify" value="Modify Your Record" class="submit" 
/>
+  </form>
+-->
+
+<h3>Contact Preferences</h3>
+<div class="form">
+  <form action="/cgi-bin/koha/opac-userdetails.pl" method="post">
+    <input type="hidden" name="updatePrefs" value="updatePrefs" />
+    <table>
+      <tr>
+        <th><label for="notifyByMail">Notify By Mail</label></th>
+        <td><input <!-- TMPL_IF NAME="notifyByMail" -->checked <!-- /TMPL_IF 
-->type="checkbox" name="notifyByMail" value="1" /></td>
+      </tr>
+      <tr>
+        <th><label for="notifyByEmail">Notify By Email</label></th>
+        <td><input  <!-- TMPL_IF NAME="notifyByEmail" -->checked <!-- /TMPL_IF 
-->type="checkbox" name="notifyByEmail" value="1" /></td>
+      <tr>
+        <th><label for="notifyByMail">Notify By SMS</label></th>
+        <td><input  <!-- TMPL_IF NAME="notifyBySMS" -->checked <!-- /TMPL_IF 
-->disabled type="checkbox" name="notifyBySMS" value="1" /></td>
+      </tr>
+      <tr>
+        <td><input type="submit" name="Update" value="Update Preferences" 
class="submit" /></td>
+      </tr>
+    </table>
+  </form>
+</div>
 </div>
 </div>
 </div>

Index: opac/opac-userdetails.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-userdetails.pl,v
retrieving revision 1.8.2.6.2.1
retrieving revision 1.8.2.6.2.2
diff -u -b -r1.8.2.6.2.1 -r1.8.2.6.2.2
--- opac/opac-userdetails.pl    18 Aug 2006 16:14:15 -0000      1.8.2.6.2.1
+++ opac/opac-userdetails.pl    31 Oct 2007 13:07:29 -0000      1.8.2.6.2.2
@@ -27,6 +27,22 @@
 if($languages_count > 1){
         $template->param(languages => address@hidden);
 }
+
+# update preferences
+if ( $query->{'updatePrefs'} ) {
+       my $notifyByMail = $query->param('notifyByMail');
+       my $notifyByEmail = $query->param('notifyByEmail');
+       my $notifyBySMS = $query->param('notifyBySMS');
+       
+warn "$notifyByMail - $notifyByEmail";
+       my $dbh = C4::Context->dbh;  
+       my $sth = $dbh->prepare(
+               "UPDATE borrowers SET notifyByMail = ?, notifyByEmail = ?, 
notifyBySMS = ?
+               WHERE borrowernumber = ?"
+        );
+       $sth->execute( $notifyByMail, $notifyByEmail, $notifyBySMS, 
$borrowernumber );
+       $sth->finish;
+}
 # get borrower information ....
 my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
 
@@ -35,7 +51,6 @@
 $borr->{'dateofbirth'}  = format_date($borr->{'dateofbirth'});
 $borr->{'ethnicity'}    = fixEthnicity($borr->{'ethnicity'});
 
-
 $template->param($borr);
 $template->param(LibraryName => C4::Context->preference("LibraryName"),
        );




reply via email to

[Prev in Thread] Current Thread [Next in Thread]