use C4::Utils::DataTables qw( dt_get_params );
use C4::Utils::DataTables::Members qw( search );
use Koha::DateUtils qw( output_pref dt_from_string );
+use Koha::Patrons;
my $input = new CGI;
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { borrowers => 1 }
+ flagsrequired => { borrowers => 'edit_borrowers' }
});
my $searchmember = $input->param('searchmember');
my $has_permission = $input->param('has_permission');
my $selection_type = $input->param('selection_type');
-if ( $searchfieldstype eq "dateofbirth" ) {
- $searchmember = output_pref({dt => dt_from_string($searchmember), dateformat => 'iso', dateonly => 1});
-}
-
# variable information for DataTables (id)
my $sEcho = $input->param('sEcho');
and $searchfieldstype
and $searchfieldstype eq 'standard' )
{
- my $member = C4::Members::GetMember( cardnumber => $searchmember );
+ my $member = Koha::Patrons->find( { cardnumber => $searchmember } );
$results = {
iTotalRecords => 1,
iTotalDisplayRecords => 1,
- patrons => [ $member ],
+ patrons => [ $member->unblessed ],
} if $member;
}
my ( $permission, $subpermission ) = split /\./, $has_permission;
my @patrons_with_permission;
for my $patron ( @{ $results->{patrons} } ) {
- my $perms = haspermission( $patron->{userid} );
+ my $perms = haspermission( $patron->{userid}, undef );
if ( $perms->{superlibrarian} == 1
or $perms->{$permission} == 1 )
{
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.
+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 3 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.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+You should have received a copy of the GNU General Public License
+along with Koha; if not, see <http://www.gnu.org/licenses>.