From f86d770a54ff2bde8d2bdf6d7bc19b9b7dd745ab Mon Sep 17 00:00:00 2001 From: Mason James Date: Mon, 26 Nov 2007 01:46:40 -0600 Subject: [PATCH] BUG-1533, adding sys-pref search back in, too handy for deving/testing. Signed-off-by: Joshua Ferraro --- admin/systempreferences.pl | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 5fa34e53b1..79062dcf99 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -50,6 +50,8 @@ use C4::ClassSource; use C4::Output; use C4::Context; +# use Smart::Comments; + # FIXME, shouldnt we store this stuff in the systempreferences table? @@ -216,7 +218,23 @@ sub StringSearch { my $count=@data; my @results; my $cnt=0; - if ($type){ + + # used for doing a plain-old sys-pref search + if ($type eq 'all' ){ + my $sth=$dbh->prepare("SELECT * FROM systempreferences + WHERE variable LIKE ? OR explanation LIKE ? + ORDER BY VARIABLE"); + $sth->execute("%$searchstring%", "%$searchstring%"); + while (my $data=$sth->fetchrow_hashref){ + $data->{value} =~ s/{value} =~ s/>/>/g; + $data->{value}=substr($data->{value},0,100)."..." if length($data->{value}) >100; + push(@results,$data); + $cnt++; + } + $sth->finish; + + } elsif ($type){ foreach my $syspref (sort keys %tabsysprefs){ if ($tabsysprefs{$syspref} eq $type){ my $sth=$dbh->prepare("Select variable,value,explanation,type,options from systempreferences where (variable like ?) order by variable"); @@ -473,12 +491,12 @@ if ($op eq 'add_form') { my $sth=$dbh->prepare("delete from systempreferences where variable=?"); $sth->execute($searchfield); $sth->finish; + # END $OP eq DELETE_CONFIRMED ################## DEFAULT ################################## } else { # DEFAULT #Adding tab management for system preferences my $tab=$input->param('tab'); - my ($count,$results)=StringSearch($searchfield,$tab); my $toggle=0; my @loop_data = (); -- 2.39.5