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

(-)a/admin/categorie.pl (-3 / +7 lines)
Lines 49-56 use C4::Form::MessagingPreferences; Link Here
49
sub StringSearch  {
49
sub StringSearch  {
50
	my ($searchstring,$type)=@_;
50
	my ($searchstring,$type)=@_;
51
	my $dbh = C4::Context->dbh;
51
	my $dbh = C4::Context->dbh;
52
        $searchstring //= '';
52
	$searchstring=~ s/\'/\\\'/g;
53
	$searchstring=~ s/\'/\\\'/g;
53
	my @data=split(' ',$searchstring);
54
	my @data=split(' ',$searchstring);
55
        push @data,q{} if $#data==-1;
54
	my $count=@data;
56
	my $count=@data;
55
	my $sth=$dbh->prepare("Select * from categories where (description like ?) order by category_type,description,categorycode");
57
	my $sth=$dbh->prepare("Select * from categories where (description like ?) order by category_type,description,categorycode");
56
	$sth->execute("$data[0]%");
58
	$sth->execute("$data[0]%");
Lines 67-73 my $input = new CGI; Link Here
67
my $searchfield=$input->param('description');
69
my $searchfield=$input->param('description');
68
my $script_name="/cgi-bin/koha/admin/categorie.pl";
70
my $script_name="/cgi-bin/koha/admin/categorie.pl";
69
my $categorycode=$input->param('categorycode');
71
my $categorycode=$input->param('categorycode');
70
my $op = $input->param('op');
72
my $op = $input->param('op') // '';
71
73
72
my ($template, $loggedinuser, $cookie)
74
my ($template, $loggedinuser, $cookie)
73
    = get_template_and_user({template_name => "admin/categorie.tmpl",
75
    = get_template_and_user({template_name => "admin/categorie.tmpl",
Lines 240-250 if ($op eq 'add_form') { Link Here
240
        while ( my $branch = $sth->fetchrow_hashref ) {
242
        while ( my $branch = $sth->fetchrow_hashref ) {
241
            push @selected_branches, $branch;
243
            push @selected_branches, $branch;
242
        }
244
        }
245
        my $enrolmentperioddate = $results->[$i]{'enrolmentperioddate'};
246
        $enrolmentperioddate = undef if $enrolmentperioddate eq '0000-00-00';
247
        $enrolmentperioddate = C4::Dates::format_date($enrolmentperioddate);
243
		my %row = (
248
		my %row = (
244
		        categorycode            => $results->[$i]{'categorycode'},
249
		        categorycode            => $results->[$i]{'categorycode'},
245
				description             => $results->[$i]{'description'},
250
				description             => $results->[$i]{'description'},
246
				enrolmentperiod         => $results->[$i]{'enrolmentperiod'},
251
				enrolmentperiod         => $results->[$i]{'enrolmentperiod'},
247
				enrolmentperioddate     => C4::Dates::format_date($results->[$i]{'enrolmentperioddate'}),
252
				enrolmentperioddate     => $enrolmentperioddate,
248
				upperagelimit           => $results->[$i]{'upperagelimit'},
253
				upperagelimit           => $results->[$i]{'upperagelimit'},
249
				dateofbirthrequired     => $results->[$i]{'dateofbirthrequired'},
254
				dateofbirthrequired     => $results->[$i]{'dateofbirthrequired'},
250
				enrolmentfee            => sprintf("%.2f",$results->[$i]{'enrolmentfee'}),
255
				enrolmentfee            => sprintf("%.2f",$results->[$i]{'enrolmentfee'}),
251
- 

Return to bug 11513