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 430-432 INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) V Link Here
430
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 ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
431
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo');
431
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo');
432
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo');
432
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo');
433
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 (+7 lines)
Lines 7067-7072 if ( CheckVersion($DBversion) ) { Link Here
7067
    SetVersion($DBversion);
7067
    SetVersion($DBversion);
7068
}
7068
}
7069
7069
7070
$DBversion = "3.13.00.XXX";
7071
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
7072
    $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')");
7073
    print "Upgrade to $DBversion done (Bug 5904: Add syspref IndependentBranchPatron)\n";
7074
    SetVersion ($DBversion);
7075
}
7076
7070
=head1 FUNCTIONS
7077
=head1 FUNCTIONS
7071
7078
7072
=head2 TableExists($table)
7079
=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