Permalink
Browse files

Merge branch 'Bug3468' into ptfs-master

Conflicts:

	koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tmpl
  • Loading branch information...
2 parents 385bf3d + f84dc0a commit dc27b7249b24d0f22ef525cd315324fd9d9aa3fa J. David Bavousett committed Apr 28, 2010
View
15 C4/Accounts.pm
@@ -699,6 +699,21 @@ sub ReversePayment {
}
}
+sub MemberOwesOnDebtCollection {
+ my ( $borrowernumber ) = @_;
+ my $dbh = C4::Context->dbh;
+ my $sql = "SELECT SUM(amountoutstanding) as stillOwing FROM accountlines, borrowers
+ WHERE borrowers.borrowernumber = ?
+ AND borrowers.borrowernumber = accountlines.borrowernumber
+ AND accountlines.date <= borrowers.last_reported_date";
+ my $sth = $dbh->prepare( $sql );
+ $sth->execute( $borrowernumber );
+ my $row = $sth->fetchrow_hashref;
+ my $amount = $row->{'stillOwing'};
+
+ return $amount;
+}
+
END { } # module clean-up code here (global destructor)
1;
View
49 C4/Members.pm
@@ -39,6 +39,8 @@ BEGIN {
#Get data
push @EXPORT, qw(
&SearchMember
+ &SearchMemberField
+ &SearchMemberBySQL
&GetMemberDetails
&GetMember
@@ -259,6 +261,53 @@ AND attribute like ?
return ( scalar(@$data), $data );
}
+sub SearchMemberField {
+ my ($searchstring, $orderby, $field ) = @_;
+ my $dbh = C4::Context->dbh;
+ my $query = "";
+ my $count;
+ my @data;
+ my @bind = ();
+
+ $searchstring =~ s/\*/%/g;
+
+ return SearchMember( $searchstring, $orderby ) unless ( $field );
+
+ my $where = "WHERE $field LIKE '$searchstring'";
+
+ if ( $field eq 'email' ) {
+ $where = "WHERE ( email LIKE '$searchstring' OR emailpro LIKE '$searchstring' )";
+ }
+ elsif ( $field eq 'phonenumber' ) {
+ $searchstring =~ s/ /%/g; ## Replaces all instances of a space with %
+ $searchstring =~ s/-/%/g; ## Replaces all instances of - with %
+ $searchstring =~ s/\(/%/g; ## Replaces all instances of ( with %
+ $searchstring =~ s/\)/%/g; ## Replaces all instances of ( with %
+ $where = "WHERE ( phone LIKE '$searchstring' OR phonepro LIKE '$searchstring' )";
+ }
+
+ # this is used by circulation everytime a new borrowers cardnumber is scanned
+ # so we can check an exact match first, if that works return, otherwise do the rest
+ $query = "SELECT * FROM borrowers
+ LEFT JOIN categories ON borrowers.categorycode=categories.categorycode
+ $where ORDER BY $orderby";
+ my $sth = $dbh->prepare($query);
+ $sth->execute();
+ my $data = $sth->fetchall_arrayref({});
+
+ return ( scalar(@$data), $data );
+}
+
+sub SearchMemberBySQL {
+ my ( $query ) = @_;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare( $query );
+ $sth->execute();
+ my $data = $sth->fetchall_arrayref({});
+ $sth->finish;
+ return( scalar( @$data ), $data );
+}
+
=head2 GetMemberDetails
($borrower) = &GetMemberDetails($borrowernumber, $cardnumber);
View
5 circ/circulation.pl
@@ -99,6 +99,9 @@
}
my $borrowernumber = $query->param('borrowernumber');
+my $orderby = $query->param('orderby');
+my $searchfield = $query->param('searchfield');
+
$branch = C4::Context->userenv->{'branch'};
$printer = C4::Context->userenv->{'branchprinter'};
@@ -228,7 +231,7 @@
my $borrowerslist;
my $message;
if ($findborrower) {
- my ($count, $borrowers) = SearchMember($findborrower, 'cardnumber', 'web');
+ my ($count, $borrowers) = SearchMemberField( $findborrower, $orderby, $searchfield );
my @borrowers = @$borrowers;
if (C4::Context->preference("AddPatronLists")) {
$template->param(
View
39 koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc
@@ -46,19 +46,32 @@ YAHOO.util.Event.onContentReady("header_search", function() {
<p class="tip">Enter patron card number or partial name:</p>
<form action="/cgi-bin/koha/circ/circulation.pl" method="post">
<!-- TMPL_IF NAME="CircAutocompl" -->
- <div class="autocomplete">
- <div id="borrowerautocomplete" class="autocomplete">
- <input autocomplete="off" id="findborrower" name="findborrower" size="40" class="focus" type="text" />
- <div id="yborrowercontainer"></div>
- <input id="ysearchsubmit" type="submit" class="submit" value="Submit" />
- <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
- <input name="printer" value="" type="hidden" />
- <!-- TMPL_IF NAME="stickyduedate" -->
- <input type="hidden" name="duedatespec" value="<!-- TMPL_VAR NAME="duedatespec" -->" />
- <input type="hidden" name="stickyduedate" value="<!-- TMPL_VAR NAME="stickyduedate" -->" />
- <!-- /TMPL_IF -->
- </div>
- </div>
+ <nobr>
+ <div class="autocomplete">
+ <div id="borrowerautocomplete" class="autocomplete">
+ <input autocomplete="off" id="findborrower" name="findborrower" type="text" />
+ <div id="yborrowercontainer"></div>
+
+ <label for="searchfield">Search Fields:</label>
+ <select name="searchfield" id="searchfield">
+ <option value="">Standard</option>
+ <option value="email">E-Mail</option>
+ <option value="borrowernumber">Borrower Number</option>
+ <option value="phonenumber">Phone Number</option>
+ </select>
+
+ <label for="orderby">Order By:</label>
+ <select name="orderby" id="searchorderby">
+ <option value="surname,firstname">Surname</option>
+ <option value="cardnumber">Cardnumber</option>
+ </select>
+
+ <input id="ysearchsubmit" type="submit" class="submit" value="Submit" />
+ <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
+ <input name="printer" value="" type="hidden" />
+ </div>
+ </div>
+ </nobr>
<!-- TMPL_ELSE -->
<input id="findborrower" name="findborrower" size="40" class="focus" type="text" />
<input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
View
86 koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc
@@ -46,39 +46,65 @@ YAHOO.util.Event.onContentReady("header_search", function() {
</script><!-- /TMPL_IF --><!-- /TMPL_IF -->
<div id="header_search">
<div id="patron_search" class="residentsearch">
- <p class="tip">Enter patron card number or partial name:</p>
- <form action="/cgi-bin/koha/members/member.pl" method="post">
- <input id="searchmember" size="25" class="focus" name="member" type="text" />
- order by:
- <select name="orderby" id="searchorderby">
- <option value="surname,firstname">Surname</option>
- <option value="cardnumber">Cardnumber</option>
- </select>
- <input value="Search" class="submit" type="submit" />
-</form>
+ <p class="tip">Enter first and/or last name or card number for standard search. For email or phone, you may enter partial text with a * for truncation (e.g., myemail* or *111-2222).</p>
+ <form action="/cgi-bin/koha/members/member.pl" method="post">
+ <input id="searchmember" class="focus" name="member" type="text" />
+ <label for="searchfield">Search Fields:</label>
+ <select name="searchfield" id="searchfield">
+ <option value="">Standard</option>
+ <option value="email">E-Mail</option>
+ <option value="borrowernumber">Borrower Number</option>
+ <option value="phonenumber">Phone Number</option>
+ </select>
+ <label for="orderby">Order By:</label>
+ <select name="orderby" id="searchorderby">
+ <option value="surname,firstname">Surname</option>
+ <option value="cardnumber">Cardnumber</option>
+ </select>
+ <input value="Search" class="submit" type="submit" />
+ </form>
</div>
+
<!-- TMPL_IF NAME="CAN_user_circulate" -->
- <div id="circ_search" class="residentsearch" style="display:none;">
- <p class="tip">Enter patron card number or partial name:</p>
- <form action="/cgi-bin/koha/circ/circulation.pl" method="post">
- <!-- TMPL_IF NAME="CircAutocompl" -->
- <div class="autocomplete">
- <div id="borrowerautocomplete" class="autocomplete">
- <input autocomplete="off" id="findborrower" name="findborrower" type="text" />
- <div id="yborrowercontainer"></div>
- <input id="ysearchsubmit" type="submit" class="submit" value="Submit" />
- <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
- <input name="printer" value="" type="hidden" />
- </div>
- </div>
- <!-- TMPL_ELSE -->
- <input id="findborrower" name="findborrower" size="40" type="text" />
- <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
- <input name="printer" value="" type="hidden" />
- <input value="Submit" class="submit" type="submit" />
+ <div id="circ_search" class="residentsearch" style="display:none;">
+ <p class="tip">Enter first and/or last name or card number for standard search. For email or phone, you may enter partial text with a * for truncation (e.g., myemail* or *111-2222).</p>
+ <form action="/cgi-bin/koha/circ/circulation.pl" method="post">
+ <!-- TMPL_IF NAME="CircAutocompl" -->
+ <nobr>
+ <div class="autocomplete">
+ <div id="borrowerautocomplete" class="autocomplete">
+ <input autocomplete="off" id="findborrower" name="findborrower" type="text" />
+ <div id="yborrowercontainer"></div>
+
+ <label for="searchfield">Search Fields:</label>
+ <select name="searchfield" id="searchfield">
+ <option value="">Standard</option>
+ <option value="email">E-Mail</option>
+ <option value="borrowernumber">Borrower Number</option>
+ <option value="phonenumber">Phone Number</option>
+ </select>
+
+ <label for="orderby">Order By:</label>
+ <select name="orderby" id="searchorderby">
+ <option value="surname,firstname">Surname</option>
+ <option value="cardnumber">Cardnumber</option>
+ </select>
+
+ <input id="ysearchsubmit" type="submit" class="submit" value="Submit" />
+ <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
+ <input name="printer" value="" type="hidden" />
+ </div>
+ </div>
+ </nobr>
+ <!-- TMPL_ELSE -->
+ <input id="findborrower" name="findborrower" size="40" type="text" />
+ <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
+ <input name="printer" value="" type="hidden" />
+ <input value="Submit" class="submit" type="submit" />
+ <!-- /TMPL_IF -->
+ </form>
+ </div>
<!-- /TMPL_IF -->
- </form>
- </div><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_catalogue" -->
<div id="catalog_search" class="residentsearch" style="display:none;">
<p class="tip">Enter search keywords:</p>
View
439 koha-tmpl/intranet-tmpl/prog/en/js/borrower-basket.js
@@ -0,0 +1,439 @@
+//////////////////////////////////////////////////////////////////////////////
+// BASIC FUNCTIONS FOR COOKIE MANAGEMENT //
+//////////////////////////////////////////////////////////////////////////////
+
+var CGIBIN = "/cgi-bin/koha/";
+
+
+var nameCookie = "borrower_list";
+var valCookie = readCookie(nameCookie);
+
+if(valCookie){
+ var arrayRecords = valCookie.split("/");
+ if(arrayRecords.length > 0){
+ var basketcount = arrayRecords.length-1;
+ } else {
+ var basketcount = "";
+ }
+} else {
+ var basketcount = "";
+}
+
+function writeCookie(name, val, wd) {
+ if (wd) {
+ parent.opener.document.cookie = name + "=" + val;
+ }
+ else {
+ parent.document.cookie = name + "=" + val;
+ }
+}
+
+function readCookieValue (str, val_beg) {
+ var val_end = str.indexOf(";", val_end);
+ if (val_end == -1)
+ val_end = str.length;
+ return str.substring(val_beg, val_end);
+}
+
+function readCookie(name, wd) {
+ var str_name = name + "=";
+ var str_len = str_name.length;
+ var str_cookie = "";
+ if (wd) {
+ str_cookie = parent.opener.document.cookie;
+ }
+ else {
+ str_cookie = parent.document.cookie;
+ }
+ // fixed - getting the part of the basket that is borrower_list
+ var cookie_parts = str_cookie.split(";");
+ for(var i=0;i < cookie_parts.length;i++) {
+ var c = cookie_parts[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if(c.indexOf(str_name) == 0) return c.substring(str_name.length,c.length);
+ }
+ return null;
+}
+
+function delCookie(name) {
+ var exp = new Date();
+ exp.setTime(exp.getTime()-1);
+ if(parent.opener){
+ parent.opener.document.cookie = name + "=null; expires=" + exp.toGMTString();
+ } else {
+ document.cookie = name + "=null; expires=" + exp.toGMTString();
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+// SPECIFIC FUNCTIONS USING COOKIES //
+///////////////////////////////////////////////////////////////////
+
+function openBasket() {
+ var strCookie = "";
+ var nameCookie = "borrower_list";
+ var valCookie = readCookie(nameCookie);
+ if ( valCookie ) {
+ strCookie = nameCookie + "=" + valCookie;
+ }
+
+ if ( strCookie ) {
+ var iW = 820;
+ var iH = 450;
+ var optWin = "dependant=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW;
+ var loc = CGIBIN + "members/borrower-basket.pl?" + strCookie;
+ var basket = open(loc, "basket", optWin);
+ if (window.focus) {basket.focus()}
+ }
+ else {
+ showCartUpdate(MSG_BASKET_EMPTY);
+ }
+}
+
+function addRecord(val, selection,NoMsgAlert) {
+ var nameCookie = "borrower_list";
+ var valCookie = readCookie(nameCookie);
+ var write = 0;
+
+ if ( ! valCookie ) { // empty basket
+ valCookie = val + '/';
+ write = 1;
+ updateBasket(1);
+ }
+ else {
+ // is this record already in the basket ?
+ var found = false;
+ var arrayRecords = valCookie.split("/");
+ for (var i = 0; i < valCookie.length - 1; i++) {
+ if (val == arrayRecords[i]) {
+ found = true;
+ break;
+ }
+ }
+ if ( found ) {
+ if (selection) {
+ return 0;
+ }
+ if (! NoMsgAlert ) {
+ showCartUpdate(MSG_RECORD_IN_BASKET);
+ }
+ }
+ else {
+ valCookie += val + '/';
+ write = 1;
+ updateBasket(arrayRecords.length);
+ }
+ }
+
+ if (write) {
+ writeCookie(nameCookie, valCookie);
+ if (selection) { // when adding a selection of records
+ return 1;
+ }
+ if (! NoMsgAlert ) {
+ showCartUpdate(MSG_RECORD_ADDED);
+ }
+ }
+}
+
+function AllAreChecked(s){
+ if (! s.length) { return false;}
+ var l = s.length;
+ for (var i=0; i < l; i++) {
+ if(! s[i].checked) { return false; }
+ }
+ return true;
+}
+
+function SelectAll(){
+ if(document.bookbag_form.borrowernumber.length > 0) {
+ var checky = AllAreChecked(document.bookbag_form.borrowernumber);
+ var l = document.bookbag_form.borrowernumber.length;
+ for (var i=0; i < l; i++) {
+ document.bookbag_form.borrowernumber[i].checked = (checky) ? false : true;
+ }
+ }
+}
+
+function addMultiple(){
+ var c_value = "";
+ if(document.bookbag_form.borrowernumber.length > 0) {
+ for (var i=0; i < document.bookbag_form.borrowernumber.length; i++) {
+ if (document.bookbag_form.borrowernumber[i].checked) {
+ c_value = c_value + document.bookbag_form.borrowernumber[i].value + "/";
+ }
+ }
+ addSelRecords(c_value);
+ } else {
+ c_value = c_value + document.bookbag_form.borrowernumber.value + "/";
+ addSelRecords(c_value);
+ }
+}
+
+function addSelRecords(valSel) { // function for adding a selection of biblios to the basket
+ // from the results list
+ var arrayRecords = valSel.split("/");
+ var i = 0;
+ var nbAdd = 0;
+ for (i=0;i<arrayRecords.length;i++) {
+ if (arrayRecords[i]) {
+ nbAdd += addRecord(arrayRecords[i], 1);
+ }
+ else {
+ break;
+ }
+ }
+ var msg = "";
+ if (nbAdd) {
+ if (i > nbAdd) {
+ msg = nbAdd+" "+MSG_NRECORDS_ADDED+", "+(i-nbAdd)+" "+MSG_NRECORDS_IN_BASKET;
+ }
+ else {
+ msg = nbAdd+" "+MSG_NRECORDS_ADDED;
+ }
+ }
+ else {
+ if (i < 1) {
+ msg = MSG_NO_RECORD_SELECTED;
+ }
+ else {
+ msg = MSG_NO_RECORD_ADDED+" ("+MSG_NRECORDS_IN_BASKET+") !";
+ }
+ }
+ showCartUpdate(msg);
+}
+
+function showCartUpdate(msg){
+ // set body of popup window
+ $("#cartDetails").html(msg);
+ showCart();
+ setTimeout("hideCart()",2000);
+}
+
+function selRecord(num, status) {
+ var str = document.myform.records.value
+ if (status){
+ str += num+"/";
+ }
+ else {
+ str = delRecord(num, str);
+ }
+
+ document.myform.records.value = str;
+}
+
+function delSelRecords() {
+ var recordsSel = 0;
+ var end = 0;
+ var nameCookie = "borrower_list";
+ var valCookie = readCookie(nameCookie, 1);
+
+ if (valCookie) {
+ var str = document.myform.records.value;
+ if (str.length > 0){
+ recordsSel = 1;
+ var str2 = valCookie;
+ while (!end){
+ s = str.indexOf("/");
+ if (s>0){
+ num = str.substring(0, s)
+ str = delRecord(num,str);
+ str2 = delRecord(num,str2);
+ } else {
+ end = 1;
+ }
+ }
+
+ if (str2.length == 0) { // equivalent to emptying the basket
+ var rep = false;
+ rep = confirm(MSG_CONFIRM_DEL_BASKET);
+ if (rep) {
+ delCookie(nameCookie);
+ document.location = "about:blank";
+ updateBasket(0,top.opener);
+ window.close();
+ } else {
+ return;
+ }
+ } else {
+ writeCookie(nameCookie, str2, 1);
+ }
+ }
+ }
+
+ if (recordsSel) {
+ var strCookie = "";
+ var nameCookie = "borrower_list";
+ var valCookie = readCookie(nameCookie, 1);
+ strCookie = nameCookie + "=" + valCookie;
+ var arrayRecords = valCookie.split("/");
+ updateBasket(arrayRecords.length-1,top.opener);
+ document.location = CGIBIN + "members/borrower-basket.pl?" + strCookie;
+ }
+ else {
+ alert(MSG_NO_RECORD_SELECTED);
+ }
+}
+
+function delRecord (n, s) {
+ var re = /\d/;
+ var aux = s;
+ var found = 0;
+ var pos = -1;
+
+ while (!found) {
+ pos = aux.indexOf(n, pos+1);
+ var charAfter = aux.charAt(pos+n.length); // character right after the researched string
+ if (charAfter.match(re)) { // record number inside another one
+ continue;
+ }
+ else { // good record number
+ aux = s.substring(0, pos)+ s.substring(pos+n.length+1, s.length);
+ s = aux;
+ found = 1;
+ }
+ }
+
+ return s;
+}
+
+
+function delBasket() {
+ var nameCookie = "borrower_list";
+
+ var rep = false;
+ rep = confirm(MSG_CONFIRM_DEL_BASKET);
+ if (rep) {
+ delCookie(nameCookie);
+ document.location = "about:blank";
+ updateBasket(0,top.opener);
+ window.close();
+ }
+}
+
+
+function quit() {
+ if (document.myform.records.value) {
+ var rep = false;
+ rep = confirm(MSG_CONFIRM_DEL_RECORDS);
+ if (rep) {
+ delSelRecords();
+ }
+ }
+ updateBasket(arrayRecords.length-1,top.opener);
+ window.close();
+}
+
+function sendBasket() {
+ var nameCookie = "borrower_list";
+ var valCookie = readCookie(nameCookie);
+ var strCookie = nameCookie + "=" + valCookie;
+
+ var loc = CGIBIN + "opac-sendbasket.pl?" + strCookie;
+
+ var optWin="dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100";
+ var win_form = open(loc,"win_form",optWin);
+}
+
+function printBasket() {
+ var loc = document.location + "&print=1";
+ document.location = loc;
+}
+
+function showMore() {
+ var strCookie = "";
+
+ var nameCookie = "borrower_list";
+ var valCookie = readCookie(nameCookie);
+ if (valCookie) {
+ strCookie = nameCookie + "=" + valCookie;
+ }
+ var loc = CGIBIN + "members/borrower-basket.pl?" + strCookie + "&verbose=1";
+ document.location = loc;
+}
+
+function showLess() {
+ var strCookie = "";
+
+ var nameCookie = "borrower_list";
+ var valCookie = readCookie(nameCookie);
+ if (valCookie) {
+ strCookie = nameCookie + "=" + valCookie;
+ }
+ var loc = CGIBIN + "members/borrower-basket.pl?" + strCookie + "&verbose=0";
+ document.location = loc;
+}
+
+function updateBasket(updated_value,target) {
+ if(target){
+ target.$('#basketcount').html("<span>"+updated_value+"</span>");
+ target.$('#cartDetails').html(_("Your cart contains ")+updated_value+_(" items"));
+ } else {
+ $('#basketcount').html("<span>"+updated_value+"</span>");
+ $('#cartDetails').html(_("Your cart contains ")+updated_value+_(" items"));
+ }
+ var basketcount = updated_value;
+}
+
+function openBiblio(dest,borrowernumber) {
+ openerURL=dest+"?borrowernumber="+borrowernumber;
+ opener.document.location = openerURL;
+ opener.focus();
+}
+
+function addSelToShelf() {
+ var items = document.getElementById('records').value;
+ if(items){
+ document.location = "/cgi-bin/koha/opac-addbyborrowernumber.pl?borrowernumber="+items;
+ } else {
+ alert(MSG_NO_RECORD_SELECTED);
+ }
+}
+
+/// vShelfAdd() builds url string for multiple-biblio adds.
+
+function vShelfAdd() {
+ bibs= new Array;
+ if(document.bookbag_form.borrowernumber.length > 0) {
+ for (var i=0; i < document.bookbag_form.borrowernumber.length; i++) {
+ if (document.bookbag_form.borrowernumber[i].checked) {
+ bibs.push("borrowernumber=" + document.bookbag_form.borrowernumber[i].value);
+ }
+ }
+ return bibs.join("&");
+ } else {
+ if (document.bookbag_form.borrowernumber.checked) {
+ return "borrowernumber=" + document.bookbag_form.borrowernumber.value;
+ }
+ }
+}
+
+function showCart(){
+ var position = $("#cartmenulink").offset();
+// var top = position.top + $("#cartmenulink").outerHeight();
+ var menuWidth = 200;
+// var buttonWidth = $("#cartmenulink").innerWidth();
+ var buttonOffset = menuWidth - buttonWidth;
+ var left = position.left - buttonOffset;
+ $("#cartDetails").css("position","absolute").css("top",top);
+ $("#cartDetails").css("position","absolute").css("left",left);
+ $("#cartDetails").fadeIn("fast",function(){
+ $("#cartDetails").dropShadow({left: 3, top: 3, blur: 0, color: "#000", opacity: 0.1});
+ });
+}
+
+function hideCart(){
+ $(".dropShadow").hide();
+ $("#cartDetails").fadeOut("fast");
+}
+
+$("#cartDetails").ready(function(){
+ $("#cartDetails,#cartmenulink").click(function(){ hideCart(); });
+ $("#cartmenulink").click(function(){ openBasket(); return false; });
+// $("#cartmenulink").hoverIntent(function(){
+// showCart();
+// },function(){
+// hideCart();
+// });
+ if(basketcount){ updateBasket(basketcount) }
+});
View
135 koha-tmpl/intranet-tmpl/prog/en/modules/members/borrower-basket.tmpl
@@ -0,0 +1,135 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+<title>Borrower Cart</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<meta http-equiv="Content-Language" content="en-us" />
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.pack.js"></script>
+<script type="text/javascript">
+ //<![CDATA[
+ $(document).ready(function(){
+ $("#CheckAll").click(function(){
+ var checked = [];
+ $("#bookbag_form").checkCheckboxes("*", true).each(
+ function() {
+ selRecord(this.value,true);
+ }
+ );
+ return false;
+ });
+ $("#CheckNone").click(function(){
+ var checked = [];
+ $("#bookbag_form").unCheckCheckboxes("*",true).each(
+ function() {
+ selRecord(this.value,false);
+ }
+ );
+ return false;
+ });
+ });
+ //]]>
+</script>
+
+<script type="text/javascript" language="javascript">
+ var MSG_BASKET_EMPTY = _("Your cart is currently empty");
+ var MSG_RECORD_IN_BASKET = _("This item is already in your cart");
+ var MSG_RECORD_ADDED = _("This item has been added to your cart");
+ var MSG_NRECORDS_ADDED = _(" item(s) added to your cart");
+ var MSG_NRECORDS_IN_BASKET = _("already in your cart");
+ var MSG_NO_RECORD_SELECTED = _("No item was selected");
+ var MSG_NO_RECORD_ADDED = _("No item was added to your cart");
+ var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
+ var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
+</script>
+
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/borrower-basket.js"></script>
+
+<script type="text/javascript" language="javascript">
+ function confirmEdit() {
+ if ( confirm( 'You are about to edit all borrowers in your Borrowers Cart. Do you wish to continue?' ) ) {
+ self.opener.location='bulkedit.pl';
+ self.close();
+ } else {
+ return false;
+ }
+ }
+
+ function confirmDelete() {
+ if ( confirm( 'You are about to *delete* all borrowers in your Borrowers Cart. Do you wish to continue?' ) ) {
+ self.opener.location='bulkedit.pl?delete=1';
+ self.close();
+ } else {
+ return false;
+ }
+ }
+</script>
+
+</head>
+
+<body id="basket">
+
+<div id="doc" class="yui-t7">
+ <div class="container">
+ <h1>Borrower Cart</h1>
+
+ <div id="toolbar">
+ <ul>
+ <li><a class="empty" href="borrower-basket.pl" onclick="delBasket(); return false;">Empty Borrower Cart</a></li>
+ </ul>
+ </div>
+
+ <form action="borrower-basket.pl" method="get" name="bookbag_form" id="bookbag_form">
+
+<div class="searchresults">
+
+<p style="padding: 7px 0; border-top : 1px solid #E8E8E8;">
+ <a id="CheckAll" href="#">Select All</a>
+ <a id="CheckNone" href="#">Clear All</a> | <b>Selected items :</b>
+ <a href="#" onclick="delSelRecords(); return false;">Remove</a>
+</p>
+
+ <table style="width:100%">
+ <tr>
+ <th>&nbsp;</th>
+ <th><a href="member.pl?member=<!--TMPL_VAR Name="member" -->&amp;orderby=cardnumber">Card</a></th>
+ <th><a href="member.pl?member=<!--TMPL_VAR Name="member" -->&amp;orderby=surname">Name</a></th>
+ <th><a href="member.pl?member=<!--TMPL_VAR Name="member" -->&amp;orderby=borrowers.categorycode">Cat</a></th>
+ <th><a href="member.pl?member=<!--TMPL_VAR Name="member" -->&amp;orderby=branchcode">Library</a></th>
+ <th>Expires on</th>
+ <th>Circ note</th>
+ </tr>
+
+ <!-- TMPL_LOOP NAME="borrowers_loop" -->
+ <tr>
+ <td><input type="checkbox" id="bor<!-- TMPL_VAR NAME="borrowernumber" -->" name="borrower" value="<!-- TMPL_VAR NAME="borrowernumber" -->" title="Click to add to Borrower Cart" onclick="selRecord(value,checked);" /></td>
+ <td><!-- TMPL_VAR NAME="cardnumber" --></td>
+ <td style="white-space: nowrap;"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --></a> <br /> <!-- TMPL_VAR NAME="address" --><!-- TMPL_IF NAME="address2" --><br /><!-- TMPL_VAR NAME="address2" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="city" --><br /><!-- TMPL_VAR NAME=city --><!-- /TMPL_IF --><!-- TMPL_IF NAME="zipcode" --> <!-- TMPL_VAR NAME="zipcode" --><!-- /TMPL_IF --></td>
+ <td><!-- TMPL_VAR NAME="category_description" --> (<!-- TMPL_VAR name="category_type" -->)</td>
+ <td><!-- TMPL_VAR NAME="branchcode" --></td>
+ <td><!-- TMPL_VAR NAME="dateexpiry" --></td>
+ <td><!-- TMPL_VAR NAME="borrowernotes" --></td>
+ </tr>
+ <!-- /TMPL_LOOP -->
+ </form>
+
+
+ </div>
+</div>
+
+<form name="myform" action="borrower-basket.pl" method="get">
+ <input type="hidden" name="records" id="records" />
+</form>
+
+<table>
+ <tr>
+ <td>
+ <input type=button value="Batch Edit Borrowers" onClick="return confirmEdit();">
+ </td>
+ <td>
+ <input type=button value="Batch Delete Borrowers" onClick="confirmDelete();">
+ </td>
+ </tr>
+</table>
+
+</body>
+</html>
View
652 koha-tmpl/intranet-tmpl/prog/en/modules/members/bulkedit.tmpl
@@ -0,0 +1,652 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+<title>Koha &rsaquo; Patrons &rsaquo; Batch Edit</title>
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/members.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/borrower-basket.js"></script>
+
+<script type="text/javascript">
+ function confirmDeleteBasket() {
+ if ( confirm( 'Do you wish to clear the Borrowers Basket at this time?' ) ) {
+ delCookie('borrower_list');
+ }
+ }
+</script>
+
+<!-- TMPL_INCLUDE NAME="calendar.inc" -->
+<script type="text/JavaScript" language="JavaScript">
+//<![CDATA[
+ $(document).ready(function() {
+ $("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
+ $("#guarantordelete").click(function() {
+ $("#contact-details").hide().find('a').remove();
+ $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" });
+ $("#contactname, #contactfirstname")
+ .each(function () { this.type = 'text' })
+ .parent().find('span').remove();
+ $("#guarantorsearch").val("Set to Patron");
+ });
+ $("#select_city").change(function(){
+ var myRegEx=new RegExp(/(.*)\|(.*)/);
+ document.form.select_city.value.match(myRegEx);
+ document.form.zipcode.value=RegExp.$1;
+ document.form.city.value=RegExp.$2;
+ });
+ });
+
+ function clear_entry(node) {
+ var original = node.parentNode.parentNode;
+ $("input", original).attr('value', '');
+ $("select", original).attr('value', '');
+ }
+
+ function clone_entry(node) {
+ var original = node.parentNode.parentNode;
+ var clone = original.cloneNode(true);
+ var newId = 50 + parseInt(Math.random() * 100000);
+ $("input", clone).attr('id', function() {
+ return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+ });
+ $("input", clone).attr('name', function() {
+ return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+ });
+ $("select", clone).attr('id', function() {
+ return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+ });
+ $("select", clone).attr('name', function() {
+ return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+ });
+ original.parentNode.insertBefore(clone, original.nextSibling);
+ }
+
+//]]>
+</script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/borrower-basket.js"></script>
+
+</head>
+<body <!-- TMPL_IF NAME="finished" -->onLoad="confirmDeleteBasket();"<!-- /TMPL_IF --> >
+<!-- TMPL_INCLUDE NAME="header.inc" -->
+<!-- TMPL_INCLUDE NAME="patron-search.inc" -->
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo;
+
+<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber="> </a> &rsaquo; <strong>Batch Edit
+</strong></div>
+
+<div id="doc3" class="yui-t2">
+
+ <div id="bd">
+ <div id="yui-main">
+
+ <div class="yui-b">
+
+
+
+ <h1>
+ Batch Edit Patrons
+
+ </h1>
+
+
+
+
+<!-- TMPL_IF NAME="delete_complete" -->
+ <!-- TMPL_LOOP NAME="membersloop" -->
+ <p>
+ <!-- TMPL_IF NAME="DELETE_FAILED" -->
+ Delete Failed:
+ <!-- TMPL_IF NAME="OPEN_ISSUES" -->
+ Borrower currently has item issued to his or her account.
+ <!-- /TMPL_IF -->
+ <!-- TMPL_IF NAME="OPEN_FINES" -->
+ Borrower currently has fines due on his or her account.
+ <!-- /TMPL_IF -->
+ <!-- TMPL_IF NAME="DEBT_COLLECTIONS" -->
+ Borrower has fines from before he or she was sent to debt collections that are unpaid.
+ <!-- /TMPL_IF -->
+ <!-- TMPL_ELSE -->
+ Successfully Deleted
+ <!-- /TMPL_IF -->
+ <!-- TMPL_VAR NAME="surname" -->, <!--TMPL_VAR NAME="firstname" --> ( <!-- TMPL_VAR NAME="cardnumber" --> )
+ </p>
+ <!-- /TMPL_LOOP -->
+<!-- TMPL_ELSE -->
+
+<!-- TMPL_IF NAME="edit_complete" -->
+ <!-- TMPL_LOOP NAME="membersloop" -->
+ <p>
+ <!-- TMPL_IF NAME="updated" -->
+ Successfully Updated
+ <!-- TMPL_ELSE -->
+ Failed to Update
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_VAR NAME="surname" -->, <!--TMPL_VAR NAME="firstname" --> ( <!-- TMPL_VAR NAME="cardnumber" --> )
+ </p>
+ <!-- /TMPL_LOOP -->
+<!-- TMPL_ELSE -->
+<form name="form" id="entryform" action="/cgi-bin/koha/members/bulkedit.pl" method="post">
+
+<!--
+<fieldset class="rows" id="memberentry_identity">
+<legend>Patron identity</legend>
+ <ol>
+ <li>
+ <label for="btitle">Salutation: </label>
+ <select name="title" id="btitle">
+ <option value=""></option>
+ <option value="Mr">Mr</option>
+ <option value="Mrs">Mrs</option>
+ <option value="Miss">Miss</option>
+ <option value="Ms">Ms</option>
+ </select>
+ </li>
+
+ <li>
+ <label for="surname">Surname: </label>
+ <input type="text" id="surname" name="surname" size="20" value="" />
+ </li>
+
+ <li>
+ <label for="firstname">First name: </label>
+ <input type="text" id="firstname" name="firstname" size="20" value="" />
+ </li>
+
+ <li>
+ <label for="dateofbirth">Date of birth: </label>
+ <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="" />
+
+ <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" id="dateofbirth_button" alt="Show Calendar" />
+ <script language="JavaScript" type="text/javascript">
+ Calendar.setup(
+ {
+ inputField : "dateofbirth",
+ ifFormat : "%m/%d/%Y",
+ button : "dateofbirth_button"
+ }
+ );
+ </script>
+ </li>
+
+ <li>
+ <label for="initials">Initials: </label>
+ <input type="text" id="initials" name="initials" size="20" value="" />
+ </li>
+
+ <li>
+ <label for="othernames">Other name: </label>
+ <input type="text" id="othernames" name="othernames" size="20" value="" />
+ </li>
+
+ <li class="radio">
+ <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
+ <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
+ <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
+ </li>
+
+
+ </ol>
+</fieldset>
+-->
+
+<fieldset class="rows">
+ <legend>Main address</legend><ol>
+ <li>
+
+ <label for="streetnumber">
+
+ Street number: </label>
+ <input type="text" id="streetnumber" name="streetnumber" size="5" value="" />
+
+ </li>
+
+ <li>
+
+ <label for="address">
+
+ Address: </label>
+ <input type="text" id="address" name="address" size="35" value="" />
+
+ </li>
+ <li>
+
+ <label for="address2">
+
+
+ Address 2: </label>
+ <input type="text" id="address2" name="address2" size="35" value="" />
+
+ </li>
+ <li>
+
+ <label for="city">
+
+ City, State: </label>
+
+ <input type="text" id="city" name="city" size="20" value="" />
+
+
+ </li>
+
+ <li>
+ <label for="zipcode">
+ Zipcode: </label>
+ <input type="text" name="zipcode" id="zipcode" size="10" value="" />
+ </li>
+
+ </ol>
+ </fieldset>
+ <fieldset class="rows" id="memberentry_contact">
+ <legend>Contact</legend><ol>
+
+ <li>
+
+
+ <label for="phone">
+
+ Phone (home): </label>
+ <input type="text" id="phone" name="phone" value="" />
+
+ </li>
+ <li>
+
+ <label for="phonepro">
+
+ Phone (work): </label>
+ <input type="text" id="phonepro" name="phonepro" value="" />
+
+
+ </li>
+ <li>
+
+ <label for="mobile">
+
+ Phone (cell): </label>
+ <input type="text" id="mobile" name="mobile" value="" />
+
+ </li>
+ <li>
+
+ <label for="email">
+
+
+ Email (home): </label>
+ <input type="text" id="email" name="email" size="45" value="" />
+
+ </li>
+ <li>
+
+ <label for="emailpro">
+
+ Email (work): </label>
+ <input type="text" id="emailpro" name="emailpro" size="45" value="" />
+
+ </li>
+
+ <li>
+
+ <label for="fax">
+
+ Fax: </label>
+ <input type="text" id="fax" name="fax" value="" />
+
+ </li>
+ </ol>
+ </fieldset>
+
+
+<!-- ************************ STEP_1 *********************** -->
+
+
+
+ <fieldset class="rows" id="memberentry_address">
+ <legend>Alternate address</legend><ol>
+ <li>
+
+ <label for="B_address">
+
+ Address: </label>
+ <input type="text" id="B_address" name="B_address" size="40" value="" />
+
+
+ </li>
+ <li>
+
+ <label for="B_city">
+
+ City: </label>
+ <input type="text" id="B_city" name="B_city" size="20" value="" />
+
+ </li>
+ <li>
+
+ <label for="B_zipcode">
+
+
+ Zipcode: </label>
+ <input type="text" id="B_zipcode" name="B_zipcode" maxlength="5" size="5" value="" />
+
+ </li>
+ <li>
+
+ <label for="B_phone">
+
+ Phone: </label>
+ <input type="text" id="B_phone" name="B_phone" value="" />
+
+ </li>
+
+ <li>
+
+ <label for="B_email">
+
+ Email: </label>
+ <input type="text" id="B_email" name="B_email" size="45" value="" />
+ </li>
+ <li>
+
+ <label for="contactnote">
+
+ Contact note: </label>
+
+ <textarea id="contactnote" name="contactnote" cols="40" rows="2"></textarea>
+
+ </li>
+ </ol>
+ </fieldset>
+ <fieldset class="rows" id="memberentry_altaddress">
+ <legend>Alternate Contact</legend><ol>
+ <li>
+
+ <label for="altcontactfirstname">
+
+
+ First name:</label>
+ <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="" />
+
+ </li>
+ <li>
+
+ <label for="altcontactsurname">
+
+ Surname:</label>
+ <input type="text" name="altcontactsurname" id="altcontactsurname" value="" />
+
+ </li>
+
+ <li>
+
+ <label for="altcontactaddress1">
+
+ Address line 1:</label>
+ <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="" size="40" />
+
+ </li>
+ <li>
+
+ <label for="altcontactaddress2">
+
+ Address line 2:</label>
+
+ <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="" size="40" />
+
+ </li>
+ <li>
+
+ <label for="altcontactaddress3">
+
+ City, State:</label>
+ <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="" size="40" />
+
+ </li>
+ <li>
+
+
+ <label for="altcontactzipcode">
+
+ ZIP/Post code:</label>
+ <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="" size="5" />
+
+ </li>
+ <li>
+
+ <label for="altcontactphone">
+
+ Phone:</label>
+ <input type="text" name="altcontactphone" id="altcontactphone" value="" />
+
+
+ </li>
+ </ol>
+ </fieldset>
+
+
+
+
+
+
+
+ <fieldset class="rows" id="memberentry_library_management">
+ <li>
+ <legend>Library Management</legend><ol>
+ <label for="branchcode">Library: </label>
+ <!-- TMPL_VAR NAME="CGIbranch" -->
+ </li>
+ <li>
+ <!-- TMPL_IF NAME="typeloop" -->
+ <label for="categorycode">Category: </label>
+ <select id="categorycode" name="categorycode">
+ <!-- TMPL_LOOP NAME="typeloop" -->
+ <option value="" selected="selected"></option>
+
+ <!-- TMPL_IF EXPR="typename eq 'C'" --><optgroup label="Child"><!-- /TMPL_IF -->
+ <!-- TMPL_IF EXPR="typename eq 'A'" --><optgroup label="Adult"><!-- /TMPL_IF -->
+ <!-- TMPL_IF EXPR="typename eq 'S'" --><optgroup label="Staff"><!-- /TMPL_IF -->
+ <!-- TMPL_IF EXPR="typename eq 'I'" --><optgroup label="Organization"><!-- /TMPL_IF -->
+ <!-- TMPL_IF EXPR="typename eq 'P'" --><optgroup label="Professional"><!-- /TMPL_IF -->
+ <!-- TMPL_IF EXPR="typename eq 'X'" --><optgroup label="Statistical"><!-- /TMPL_IF -->
+ <!-- TMPL_LOOP NAME="categoryloop" -->
+ <option value="<!-- TMPL_VAR NAME="categorycode" -->"><!-- TMPL_VAR NAME="categoryname" --></option>
+ <!-- /TMPL_LOOP -->
+ </optgroup>
+ <!-- /TMPL_LOOP -->
+ </select>
+ <!-- TMPL_ELSE -->
+ <span class="problem">There is no category type to add <!--TMPL_IF Name="A"-->an Adult<!--/TMPL_IF--><!--TMPL_IF Name="C"-->a Child<!--/TMPL_IF--><!
+ <a href="/cgi-bin/koha/admin/categorie.pl">Please create one</a>
+ <!-- /TMPL_IF -->
+
+ </li>
+ <li>
+
+ <label for="sort1">
+
+ Sort 1: </label>
+
+
+ <input type="text" id="sort1" name="sort1" size="20" value="" />
+
+
+ </li>
+ <li>
+
+ <label for="sort2">
+
+ Sort 2: </label>
+
+ <input type="text" id="sort2" name="sort2" size="20" value="" />
+
+
+ </li>
+ </ol>
+
+ </fieldset>
+ <fieldset class="rows" id="memberentry_subscription">
+ <legend>Library set-up</legend><ol>
+ <li>
+
+ <label for="dateenrolled">
+
+ Registration date: </label>
+ <input type="text" id="dateenrolled" name="dateenrolled" maxlength="10" size="10" />
+ <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" id="dateenrolled_button" alt="Show Calendar" />
+
+ <script language="JavaScript" type="text/javascript">
+ Calendar.setup(
+ {
+ inputField : "dateenrolled",
+ ifFormat : "%m/%d/%Y",
+ button : "dateenrolled_button"
+ }
+ );
+ </script>
+
+
+ </li>
+ <li>
+
+ <label for="dateexpiry">
+
+ Expiry date (leave blank for auto calc) </label>
+ <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" value="" />
+ <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" id="dateexpiry_button" alt="Show Calendar" />
+ <script language="JavaScript" type="text/javascript">
+ Calendar.setup(
+ {
+ inputField : "dateexpiry",
+ ifFormat : "%m/%d/%Y",
+ button : "dateexpiry_button"
+ }
+ );
+ </script>
+
+
+
+ </li>
+ <li>
+
+ <label for="opacnote">
+
+ OPAC note: </label>
+ <textarea id="opacnote" name="opacnote" cols="55" rows="5"></textarea>
+ <div class="hint">This message appears on this patron's user page in the OPAC</div>
+ <label for="opacnotes_empty">Empty OPAC Notes?</label>
+ <input type="checkbox" name="opacnotes_empty" value="1" />
+ <div class="hint">Checking this box will clear the OPAC notes field for all borrowers being edited.</div>
+
+ </li>
+
+ <li>
+
+ <label for="borrowernotes">
+
+ Circulation note: </label>
+ <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5"></textarea>
+ <div class="hint">This message displays when checking out to this patron</div>
+ <label for="borrowernotes_empty">Empty Circulation Notes?</label>
+ <input type="checkbox" name="borrowernotes_empty" value="1" />
+ <div class="hint">Checking this box will clear the Circulation notes field for all borrowers being edited.</div>
+
+ </li>
+ </ol>
+
+ </fieldset>
+
+ <fieldset class="rows">
+ <legend>Patron Account Flags</legend>
+ <ol class="radio">
+
+ <li><label class="radio" for="yesgonenoaddress">
+ Gone no Address:
+
+
+ </label>
+
+ <label for="yesgonenoaddress">Yes </label>
+
+
+ <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" />
+
+
+ <label for="nogonenoaddress">No </label>
+
+ <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" />
+
+ <label for="nogonenoaddress">Don't Update </label>
+
+ <input type="radio" id="noupdategonenoaddress" name="gonenoaddress" value="-1" checked="checked"/>
+
+</li>
+
+ <li><label class="radio" for="yesdebarred">
+
+ Debarred:
+
+ </label>
+
+ <label for="yesdebarred">Yes </label>
+
+
+ <input type="radio" id="yesdebarred" name="debarred" value="1" />
+
+
+ <label for="nodebarred">No </label>
+
+ <input type="radio" id="nodebarred" name="debarred" value="0" />
+
+ <label for="nodebarred">Don't Update </label>
+
+ <input type="radio" id="noupdatedebarred" name="debarred" value="-1" checked="checked"/>
+
+</li>
+
+ <li><label class="radio" for="yeslost">
+
+
+ Lost Card:
+ </label>
+
+ <label for="yeslost">Yes </label>
+
+
+ <input type="radio" id="yeslost" name="lost" value="1" />
+
+
+ <label for="nolost">No </label>
+
+ <input type="radio" id="nolost" name="lost" value="0" />
+
+ <label for="nolost">Don't Update </label>
+
+ <input type="radio" id="noupdatelost" name="lost" value="-1" checked="checked"/>
+
+</li>
+
+ </ol>
+ </fieldset>
+
+
+
+
+
+
+ <fieldset class="action">
+ <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
+
+
+ <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=">Cancel</a>
+
+ </fieldset>
+
+ <input type="hidden" name="update" id="update" value="1" />
+</form>
+
+<!-- /TMPL_IF -->
+</div>
+</div>
+
+<div class="yui-b">
+
+</div>
+</div>
+
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
View
88 koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tmpl
@@ -1,19 +1,84 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Patrons <!-- TMPL_IF NAME="searching" -->&rsaquo; Search Results<!-- /TMPL_IF --></title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/borrower-basket.js"></script>
+
+<script type="text/javascript" language="javascript">
+ var MSG_BASKET_EMPTY = _("Your cart is currently empty");
+ var MSG_RECORD_IN_BASKET = _("This item is already in your cart");
+ var MSG_RECORD_ADDED = _("This item has been added to your cart");
+ var MSG_NRECORDS_ADDED = _(" item(s) added to your cart");
+ var MSG_NRECORDS_IN_BASKET = _("already in your cart");
+ var MSG_NO_RECORD_SELECTED = _("No item was selected");
+ var MSG_NO_RECORD_ADDED = _("No item was added to your cart");
+ var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
+ var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
+</script>
+
+<script language="JavaScript" type="text/javascript">
+//==========================================
+// Check All boxes
+//==========================================
+function CheckAll(fmobj) {
+ for (var i=0;i<fmobj.elements.length;i++) {
+ var e = fmobj.elements[i];
+ if ( (e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled) ) {
+ e.checked = fmobj.allbox.checked;
+ }
+ }
+}
+
+//==========================================
+// Check all or uncheck all?
+//==========================================
+function CheckCheckAll(fmobj) {
+ var TotalBoxes = 0;
+ var TotalOn = 0;
+ for (var i=0;i<fmobj.elements.length;i++) {
+ var e = fmobj.elements[i];
+ if ((e.name != 'allbox') && (e.type=='checkbox')) {
+ TotalBoxes++;
+ if (e.checked) {
+ TotalOn++;
+ }
+ }
+ }
+ if (TotalBoxes==TotalOn) {
+ fmobj.allbox.checked=true;
+ }
+ else {
+ fmobj.allbox.checked=false;
+ }
+}
+
+</script>
+
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_INCLUDE NAME="patron-search.inc" -->
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <!-- TMPL_IF NAME="searching" --><a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Search Results<!-- TMPL_ELSE -->Patrons<!-- /TMPL_IF --></div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <!-- TMPL_IF NAME="searching" --><a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Search Results<!-- TMPL_ELSE -->Patrons<!-- /TMPL_IF -->
+</div>
<div id="doc" class="yui-t7">
<div id="bd">
<div id="yui-main">
<div class="yui-g">
+<span id="cmspan">
+ <a href="#" id="cartmenulink" class="">
+ <i></i>
+ <span>
+ <i></i><span></span>
+ <img src="/opac-tmpl/prog/images/cart.gif" width="14" height="14" alt="" border="0" />
+ Borrower Cart
+ <span id="basketcount"></span>
+ </span>
+ </a>
+</span>
+
<!-- TMPL_INCLUDE NAME="patron-toolbar.inc" -->
@@ -50,10 +115,14 @@
<!-- TMPL_IF NAME="resultsloop" -->
<div id="searchheader"> <h3>Results <!-- TMPL_VAR Name ="from" --> to <!-- TMPL_VAR Name ="to" --> of <!-- TMPL_VAR Name ="numresults" --> found for '<span class="ex"><!-- TMPL_VAR NAME="member" --></span>'</h3></div>
-<div class="searchresults">
+ <p><button type="submit" class="submit" onClick="addMultiple();" >Add Selected Borrowers To Cart</button></p>
+
+<div class="searchresults">
+<form name="bookbag_form" id="bookbag_form" >
<table style="width:100%">
<tr>
+ <th><input style="border:inset 1px;" name="allbox" type="checkbox" value="Check All" onclick="CheckAll(document.bookbag_form);" /></th>
<th><a href="member.pl?member=<!--TMPL_VAR Name="member" -->&amp;orderby=cardnumber">Card</a></th>
<th><a href="member.pl?member=<!--TMPL_VAR Name="member" -->&amp;orderby=surname">Name</a></th>
<th><a href="member.pl?member=<!--TMPL_VAR Name="member" -->&amp;orderby=borrowers.categorycode">Cat</a></th>
@@ -65,7 +134,9 @@
<!-- TMPL_IF NAME="CAN_user_borrowers_edit_borrowers" -->
<th>&nbsp;</th>
<!-- /TMPL_IF -->
+ <th>&nbsp;</th>
</tr>
+
<!-- TMPL_LOOP NAME="resultsloop" -->
<!-- TMPL_IF name="overdue" -->
<tr class="problem">
@@ -76,6 +147,7 @@
<tr>
<!-- /TMPL_UNLESS -->
<!-- /TMPL_IF -->
+ <td><input type="checkbox" id="bor<!-- TMPL_VAR NAME="borrowernumber" -->" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" title="Click to add to Borrower Cart" /></td>
<td><!-- TMPL_VAR NAME="cardnumber" --></td>
<td style="white-space: nowrap;"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --></a> <br /> <!-- TMPL_VAR NAME="address" --><!-- TMPL_IF NAME="address2" --><br /><!-- TMPL_VAR NAME="address2" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="city" --><br /><!-- TMPL_VAR NAME=city --><!-- /TMPL_IF --><!-- TMPL_IF NAME="zipcode" --> <!-- TMPL_VAR NAME="zipcode" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="country" -->, <!-- TMPL_VAR NAME="country" --><!-- /TMPL_IF --></td>
<td><!-- TMPL_VAR NAME="category_description" --> (<!-- TMPL_VAR name="category_type" -->)</td>
@@ -84,6 +156,7 @@
<td><!-- TMPL_IF "overdues" --><span class="overdue"><strong><!-- TMPL_VAR NAME="overdues" --></strong></span><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="overdues" --><!-- /TMPL_IF -->/<!-- TMPL_VAR NAME="issues" --></td>
<td><!-- TMPL_VAR NAME="fines" --></td>
<td><!-- TMPL_VAR NAME="borrowernotes" --></td>
+ <td><a class="addtocart" href="#" onclick="addRecord('<!-- TMPL_VAR NAME="borrowernumber" -->'); return false;">Add&nbsp;to&nbsp;Cart</a></td>
<!-- TMPL_IF NAME="CAN_user_borrowers_edit_borrowers" -->
<td><!-- TMPL_IF NAME="category_type" -->
<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;category_type=<!-- TMPL_VAR NAME="category_type"-->">Edit</a>
@@ -97,6 +170,7 @@
<!-- /TMPL_IF -->
</tr>
<!-- /TMPL_LOOP -->
+</form>
</table>
<div class="pages"><!--TMPL_IF Name="multipage"--><!--TMPL_VAR Name="paginationbar" --><!--/TMPL_IF--></div>
</div>
@@ -106,6 +180,16 @@ No results found
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="ShowPatronSearchBySQL" -->
+ <br/>
+ <h3>Search borrowers by SQL</h3>
+ <form action="/cgi-bin/koha/members/member.pl" method="post" name="borrower-sql-search">
+ <label for="sqlsearch">SELECT * FROM borrowers LEFT JOIN categories ON borrowers.categorycode = categories.categorycode WHERE</label>
+ <textarea name="sqlsearch" rows='5' cols='100'></textarea>
+ <input name="sqlsearch" type="submit" value="Search" />
+ </form>
+<!-- /TMPL_IF -->
+
</div>
</div>
View
63 members/borrower-basket.pl
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+
+# 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., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+
+use strict;
+use CGI;
+use C4::Koha;
+use C4::Biblio;
+use C4::Items;
+use C4::Auth;
+use C4::Output;
+use C4::Members;
+
+my $query = new CGI;
+
+my ($template, $loggedinuser, $cookie) = get_template_and_user(
+ {
+ template_name => "members/borrower-basket.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {borrowers => 1},
+ debug => 1,
+ }
+);
+
+my $borrower_list = $query->param('borrower_list');
+my $print_basket = $query->param('print');
+my $verbose = $query->param('verbose');
+
+if ($verbose) { $template->param( verbose => 1 ); }
+if ($print_basket) { $template->param( print_basket => 1 ); }
+
+my @borrowers = split( /\//, $borrower_list );
+my @results;
+
+my $num = 1;
+
+foreach my $borrowernumber ( @borrowers ) {
+ $num++;
+ my $borrower = GetMember( $borrowernumber, 'borrowernumber' );
+ push( @results, $borrower );
+}
+
+$template->param(
+ borrowers_loop => \@results
+);
+
+output_html_with_http_headers $query, $cookie, $template->output;
View
284 members/bulkedit.pl
@@ -0,0 +1,284 @@
+#!/usr/bin/perl
+
+# 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., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+# pragma
+use strict;
+use warnings;
+
+# external modules
+use CGI;
+# use Digest::MD5 qw(md5_base64);
+
+# internal modules
+use C4::Auth;
+use C4::Context;
+use C4::Output;
+use C4::Members;
+use C4::Members::Attributes;
+use C4::Members::AttributeTypes;
+use C4::Koha;
+use C4::Dates qw/format_date format_date_in_iso/;
+use C4::Input;
+use C4::Log;
+use C4::Letters;
+use C4::Branch; # GetBranches
+
+use vars qw($debug);
+
+BEGIN {
+ $debug = $ENV{DEBUG} || 0;
+}
+
+my $input = new CGI;
+($debug) or $debug = $input->param('debug') || 0;
+
+
+my %data;
+
+my $dbh = C4::Context->dbh;
+
+my ($template, $loggedinuser, $cookie)
+ = get_template_and_user({template_name => "members/bulkedit.tmpl",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {borrowers => 1},
+ debug => ($debug) ? 1 : 0,
+ });
+
+
+# Pull borrowernumbers from cookie for bulk editing
+my $borrower_list = $input->cookie("borrower_list");
+my @borrowernumbers = split( /\//, $borrower_list );
+
+
+if ( $input->param('update') ) { ## Update the borrowers
+ my @fields = ( 'title', 'surname', 'firstname', 'dateofbirth', 'initials', 'othernames', 'sex',
+ 'streetnumber', 'address', 'address2', 'city', 'zipcode', 'phone', 'phonepro', 'mobile',
+ 'email', 'emailpro', 'fax', 'B_address', 'B_city', 'B_zipcode', 'B_phone', 'B_email',
+ 'contactnote', 'altcontactfirstname', 'altcontactsurname', 'altcontactaddress1', 'altcontactaddress2',
+ 'altcontactaddress3', 'altcontactzipcode', 'altcontactphone', 'branchcode', 'categorycode', 'sort1',
+ 'sort2', 'dateenrolled', 'dateexpiry', 'opacnote', 'borrowernotes', 'gonenoaddress', 'debarred', 'lost'
+ );
+
+ foreach my $field ( @fields ) {
+ if ( $input->param( "$field" ) ) { $data{ "$field" } = $input->param( "$field" ); }
+ }
+
+ ## Checkboxes
+ if ( $input->param( 'opacnotes_empty' ) ) { $data{'opacnote'} = ''; }
+ if ( $input->param( 'borrowernotes_empty' ) ) { $data{'borrowernotes'} = ''; }
+
+ ## Radio buttons
+ if ( $input->param( 'gonenoaddress' ) >= 0 ) {
+ $data{'gonenoaddress'} = $input->param( 'gonenoaddress' );
+ } else {
+ delete $data{'gonenoaddress'};
+ }
+ if ( $input->param( 'debarred' ) >= 0 ) {
+ $data{'debarred'} = $input->param( 'debarred' );
+ } else {
+ delete $data{'debarred'};
+ }
+ if ( $input->param( 'lost' ) >= 0 ) {
+ $data{'lost'} = $input->param( 'lost' );
+ } else {
+ delete $data{'lost'};
+ }
+
+ if ( $data{'dateofbirth'} ) { $data{'dateofbirth'} = format_date_in_iso( $data{'dateofbirth'} ); }
+ if ( $data{'dateenrolled'} ) { $data{'dateenrolled'} = format_date_in_iso( $data{'dateenrolled'} ); }
+ if ( $data{'dateexpirty'} ) { $data{'dateexpiry'} = format_date_in_iso( $data{'dateexpiry'} ); }
+
+ $template->param("uppercasesurnames" => C4::Context->preference('uppercasesurnames'));
+
+ my @modded_members;
+ foreach my $borrowernumber ( @borrowernumbers ) {
+ $data{ 'borrowernumber' } = $borrowernumber;
+ my $success = ModMember( %data );
+
+ my $member = GetMember( $borrowernumber, 'borrowernumber' );
+ if ( $success ) { $member->{'updated'} = 1; }
+
+ push( @modded_members, $member );
+ }
+ $template->param( finished => 1 );
+ $template->param( edit_complete => 1 );
+ $template->param( membersloop => \@modded_members );
+
+} elsif ( $input->param('delete') ) { ## Delete the borrowers
+ my @modded_members;
+ foreach my $borrowernumber ( @borrowernumbers ) {
+ my $member = GetMember( $borrowernumber, 'borrowernumber' );
+
+ my ($overdue_count, $issue_count, $total_fines) = GetMemberIssuesAndFines( $borrowernumber );
+
+ my $delete_member = 1;
+
+ if ( $issue_count > 0 ) {
+ $delete_member = 0;
+ $member->{'DELETE_FAILED'} = 1;
+ $member->{'OPEN_ISSUES'} = 1;
+ }
+
+ if ( $total_fines > 0 ) {
+ if ( C4::Context->preference('BatchMemberDeleteFineThreshhold') ) {
+ if ( $total_fines > C4::Context->preference('BatchMemberDeleteFineThreshhold') ) {
+ $delete_member = 0;
+ $member->{'DELETE_FAILED'} = 1;
+ $member->{'OPEN_FINES'} = 1;
+ }
+ } else {
+ $delete_member = 0;
+ $member->{'DELETE_FAILED'} = 1;
+ $member->{'OPEN_FINES'} = 1;
+ }
+ }
+
+ if ( C4::Context->preference('BatchMemberDeletePaidDebtCollections') ) {
+ if ( MemberOwesOnDebtCollection( $borrowernumber ) ) {
+ $delete_member = 0;
+ $member->{'DELETE_FAILED'} = 1;
+ $member->{'DEBT_COLLECTIONS'} = 1;
+ }
+ }
+
+ if ( $delete_member ) {
+ MoveMemberToDeleted( $borrowernumber ); ## Inserts borrower into deletedborrowers table
+ DelMember( $borrowernumber ); ## Deletes borrower and cancels reserves
+ }
+
+ push( @modded_members, $member );
+ }
+ $template->param( finished => 1 );
+ $template->param( delete_complete => 1 );
+ $template->param( membersloop => \@modded_members );
+
+} else { ## Build the edit form
+
+# Get patron category codes
+##Now all the data to modify a member.
+my ($categories,$labels)=ethnicitycategories();
+
+ my $ethnicitycategoriescount=$#{$categories};
+ my $ethcatpopup;
+ if ($ethnicitycategoriescount>=0) {
+ $ethcatpopup = CGI::popup_menu(-name=>'ethnicity',
+ -id => 'ethnicity',
+ -tabindex=>'',
+ -values=>$categories,
+ -default=>$data{'ethnicity'},
+ -labels=>$labels);
+ $template->param(ethcatpopup => $ethcatpopup); # bad style, has to be fixed
+ }
+
+
+my @typeloop;
+foreach (qw(C A S P I X)) {
+ my $action="WHERE category_type=?";
+ ($categories,$labels)=GetborCatFromCatType($_,$action);
+ my @categoryloop;
+ foreach my $cat (@$categories){
+ push @categoryloop,{'categorycode' => $cat,
+ 'categoryname' => $labels->{$cat},
+ };
+ }
+ my %typehash;
+ $typehash{'typename'}=$_;
+ $typehash{'categoryloop'}=\@categoryloop;
+ push @typeloop,{'typename' => $_,
+ 'categoryloop' => \@categoryloop};
+}
+$template->param('typeloop' => \@typeloop);
+
+# Get branches for library select
+my @select_branch;
+my %select_branches;
+
+my $onlymine=(C4::Context->preference('IndependantBranches') &&
+ C4::Context->userenv &&
+ C4::Context->userenv->{flags} !=1 &&
+ C4::Context->userenv->{branch}?1:0);
+
+my $branches=GetBranches($onlymine);
+my $default;
+
+$branches->{''}->{branchname} = '';
+
+for my $branch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
+ push @select_branch,$branch;
+ $select_branches{$branch} = $branches->{$branch}->{'branchname'};
+ $default = C4::Context->userenv->{'branch'} if (C4::Context->userenv && C4::Context->userenv->{'branch'});
+}
+
+my $CGIbranch = CGI::scrolling_list(-id => 'branchcode',
+ -name => 'branchcode',
+ -values => \@select_branch,
+ -labels => \%select_branches,
+ -size => 1,
+ -override => 1,
+ -multiple =>0,
+ );
+
+
+my $CGIorganisations;
+my $member_of_institution;
+if (C4::Context->preference("memberofinstitution")){
+ my $organisations=get_institutions();
+ my @orgs;
+ my %org_labels;
+ foreach my $organisation (keys %$organisations) {
+ push @orgs,$organisation;
+ $org_labels{$organisation}=$organisations->{$organisation}->{'surname'};
+ }
+ $member_of_institution=1;
+
+ $CGIorganisations = CGI::scrolling_list( -id => 'organisations',
+ -name => 'organisations',
+ -labels => \%org_labels,
+ -values => \@orgs,
+ -size => 5,
+ -multiple => 'true'
+
+ );
+}
+
+if (C4::Context->preference('uppercasesurnames')) {
+ $data{'surname'} =uc($data{'surname'} );
+ $data{'contactname'}=uc($data{'contactname'});
+}
+
+foreach (qw(dateenrolled dateexpiry dateofbirth)) {
+ $data{$_} = format_date($data{$_}); # back to syspref for display
+ $template->param( $_ => $data{$_});
+}
+
+$template->param(%data);
+
+$template->param(
+ DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+);
+
+$template->param(
+ dateformat => C4::Dates->new()->visual(),
+ C4::Context->preference('dateformat') => 1,
+ CGIbranch => $CGIbranch,
+);
+
+}
+
+output_html_with_http_headers $input, $cookie, $template->output;
View
33 members/member.pl
@@ -72,15 +72,31 @@
# die_on_bad_params => 0,
# loop_context_vars => 1 );
-my $member=$input->param('member');
-my $orderby=$input->param('orderby');
+my $member = $input->param('member');
+my $member_orig = $member;
+my $orderby = $input->param('orderby');
+my $searchfield = $input->param('searchfield');
+
$orderby = "surname,firstname" unless $orderby;
$member =~ s/,//g; #remove any commas from search string
$member =~ s/\*/%/g;
my ($count,$results);
-if(length($member) == 1)
+my $search_sql;
+if ( $input->param('sqlsearch') ) {
+ $resultsperpage = '1000';
+ $search_sql = 'SELECT * FROM borrowers LEFT JOIN categories ON borrowers.categorycode = categories.categorycode WHERE ';
+ my @parts = split( /;/, $input->param('sqlsearch') );
+ $search_sql .= $parts[0];
+ $template->param( member => $search_sql );
+ ($count, $results) = SearchMemberBySQL( $search_sql );
+}
+elsif( $searchfield ) {
+ ($count, $results)=SearchMemberField( $member, $orderby, $searchfield );
+ $template->param( searchfield => $searchfield );
+}
+elsif(length($member) == 1)
{
($count,$results)=SearchMember($member,$orderby,"simple");
}
@@ -127,10 +143,11 @@
. join(
'&amp;',
map { $_->{term} . '=' . $_->{val} } (
- { term => 'member', val => $member},
+ { term => 'member', val => $member_orig},
{ term => 'orderby', val => $orderby },
{ term => 'resultsperpage', val => $resultsperpage },
{ term => 'type', val => 'intranet' },
+ { term => 'searchfield', val => $searchfield },
)
);
@@ -147,9 +164,15 @@
$template->param(
searching => "1",
- member => $member,
+ member => $member_orig,
numresults => $count,
resultsloop => \@resultsdata,
);
+$template->param( ShowPatronSearchBySQL => C4::Context->preference('ShowPatronSearchBySQL') );
+
+if ( $input->param('sqlsearch') ) {
+ $template->param( member => $search_sql );
+}
+
output_html_with_http_headers $input, $cookie, $template->output;
View
3 members/memberentry.pl
@@ -48,6 +48,8 @@ BEGIN
my $input = new CGI;
($debug) or $debug = $input->param('debug') || 0;
+
+
my %data;
my $dbh = C4::Context->dbh;
@@ -81,6 +83,7 @@ BEGIN
my $step = $input->param('step') || 0;
my @errors;
my $default_city;
+
# $check_categorytype contains the value of duplicate borrowers category type to redirect in good template in step =2
my $check_categorytype=$input->param('check_categorytype');
# NOTE: Alert for ethnicity and ethnotes fields, they are invalid in all borrowers form
View
2 members/members-home.pl
@@ -57,4 +57,6 @@
$template->param(categories=>$categories);
}
+$template->param( ShowPatronSearchBySQL => C4::Context->preference('ShowPatronSearchBySQL') );
+
output_html_with_http_headers $query, $cookie, $template->output;

0 comments on commit dc27b72

Please sign in to comment.