View | Details | Raw Unified | Return to bug 5904
Collapse All | Expand All

(-)a/circ/ysearch.pl (-8 / +18 lines)
Lines 44-56 if ($auth_status ne "ok") { Link Here
44
}
44
}
45
45
46
my $dbh = C4::Context->dbh;
46
my $dbh = C4::Context->dbh;
47
my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode, country
47
my $sql = q(
48
             FROM borrowers
48
    SELECT surname, firstname, cardnumber, address, city, zipcode, country
49
             WHERE surname LIKE ?
49
    FROM borrowers
50
             OR firstname LIKE ?
50
    WHERE ( surname LIKE ?
51
             OR cardnumber LIKE ?
51
        OR firstname LIKE ?
52
             ORDER BY surname, firstname
52
        OR cardnumber LIKE ? )
53
             LIMIT 10);
53
);
54
if (C4::Context->preference("IndependentBranchPatron")){
55
  if ( C4::Context->userenv
56
      && (C4::Context->userenv->{flags} % 2) !=1
57
      && C4::Context->userenv->{'branch'}
58
  ){
59
     $sql .= " AND borrowers.branchcode =" . $dbh->quote(C4::Context->userenv->{'branch'});
60
  }
61
}
62
63
$sql    .= q( ORDER BY surname, firstname LIMIT 10);
54
my $sth = $dbh->prepare( $sql );
64
my $sth = $dbh->prepare( $sql );
55
$sth->execute("$query%", "$query%", "$query%");
65
$sth->execute("$query%", "$query%", "$query%");
56
66
Lines 68-71 while ( my $rec = $sth->fetchrow_hashref ) { Link Here
68
          "}";
78
          "}";
69
    $i++;
79
    $i++;
70
}
80
}
71
print "]";
81
print "]";
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 427-429 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
427
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');
427
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');
428
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
428
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
430
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('IndependentBranchPatron','0','Allow/Don\'t allow limit to the librarian branch in circ member auto completion', '', 'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 7010-7015 CREATE TABLE IF NOT EXISTS borrower_files ( Link Here
7010
    SetVersion($DBversion);
7010
    SetVersion($DBversion);
7011
}
7011
}
7012
7012
7013
7014
$DBversion = "3.13.00.XXX";
7015
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
7016
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('IndependentBranchPatron','0','Allow/Don\'t allow limit to the librarian branch in circ member auto completion', '', 'YesNo')");
7017
    print "Upgrade to $DBversion done (Bug 5904: Add syspref IndependentBranchPatron)\n";
7018
    SetVersion ($DBversion);
7019
}
7020
7021
7013
=head1 FUNCTIONS
7022
=head1 FUNCTIONS
7014
7023
7015
=head2 TableExists($table)
7024
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +7 lines)
Lines 139-141 Patrons: Link Here
139
               yes: Do
139
               yes: Do
140
               no: "Don't"
140
               no: "Don't"
141
         - enable the ability to upload and attach arbitrary files to a borrower record.
141
         - enable the ability to upload and attach arbitrary files to a borrower record.
142
- 
142
     -
143
         - pref: IndependentBranchPatron
144
           choices:
145
               yes: Prevent
146
               no: "Don't prevent"
147
         - staff (but not superlibrarians) from searching patrons belonging to other libraries.
148

Return to bug 5904