[Koha-cvs] CVS: koha/admin systempreferences.pl,1.22.2.1,1.22.2.2
Henri-Damien LAURENT
hdl at users.sourceforge.net
Tue Jun 28 11:37:19 CEST 2005
Update of /cvsroot/koha/koha/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21713/admin
Modified Files:
Tag: rel_2_2
systempreferences.pl
Log Message:
Adding system preference category.
Managing them in tabs.
Taking Paul's first improvements on Head Version into account.
Index: systempreferences.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/systempreferences.pl,v
retrieving revision 1.22.2.1
retrieving revision 1.22.2.2
diff -C2 -r1.22.2.1 -r1.22.2.2
*** systempreferences.pl 11 Feb 2005 16:23:31 -0000 1.22.2.1
--- systempreferences.pl 28 Jun 2005 09:37:17 -0000 1.22.2.2
***************
*** 49,52 ****
--- 49,80 ----
use C4::Context;
+ my %tabsysprefs;
+ $tabsysprefs{acquisitions}="Acquisitions";
+ $tabsysprefs{gist}="Acquisitions";
+ $tabsysprefs{authoritysep}="Authorities";
+ $tabsysprefs{ISBD}="Catalogue";
+ $tabsysprefs{marc}="Catalogue";
+ $tabsysprefs{marcflavour}="Catalogue";
+ $tabsysprefs{SubscriptionHistory}="Catalogue";
+ $tabsysprefs{maxoutstanding}="Circulation";
+ $tabsysprefs{printcirculationslips}="Circulation";
+ $tabsysprefs{suggestion}="Acquisitions";
+ $tabsysprefs{automembernum}="Members";
+ $tabsysprefs{noissuescharge}="Circulation";
+ $tabsysprefs{opacthemes}="OPAC";
+ $tabsysprefs{opaclanguages}="OPAC";
+ $tabsysprefs{LibraryName}="OPAC";
+ $tabsysprefs{opacstylesheet}="OPAC";
+ $tabsysprefs{BiblioDefaultView}="OPAC";
+ $tabsysprefs{hidelostitem}="OPAC";
+ $tabsysprefs{KohaAdmin}="Admin";
+ $tabsysprefs{checkdigit}="Admin";
+ $tabsysprefs{dateformat}="Admin";
+ $tabsysprefs{insecure}="Admin";
+ $tabsysprefs{ldapinfos}="Admin";
+ $tabsysprefs{ldapserver}="Admin";
+ $tabsysprefs{itemcallnumber}="Catalogue";
+ $tabsysprefs{maxreserves}="Circulation";
+ $tabsysprefs{virtualshelves}="OPAC";
sub StringSearch {
***************
*** 56,68 ****
my @data=split(' ',$searchstring);
my $count=@data;
- my $sth=$dbh->prepare("Select variable,value,explanation,type,options from systempreferences where (variable like ?) order by variable");
- $sth->execute("$data[0]%");
my @results;
my $cnt=0;
! while (my $data=$sth->fetchrow_hashref){
! push(@results,$data);
! $cnt ++;
}
- $sth->finish;
return ($cnt,\@results);
}
--- 84,117 ----
my @data=split(' ',$searchstring);
my $count=@data;
my @results;
my $cnt=0;
! if ($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");
! $sth->execute($syspref);
! while (my $data=$sth->fetchrow_hashref){
! push(@results,$data);
! $cnt++;
! }
! $sth->finish;
! }
! }
! } else {
! my $strsth ="Select variable,value,explanation,type,options from systempreferences where variable not in (";
! foreach my $syspref (keys %tabsysprefs){
! $strsth .= $dbh->quote($syspref).",";
! }
! $strsth =~ s/,$/) /;
! $strsth .= " order by variable";
! warn $strsth;
! my $sth=$dbh->prepare($strsth);
! $sth->execute();
! while (my $data=$sth->fetchrow_hashref){
! push(@results,$data);
! $cnt++;
! }
! $sth->finish;
}
return ($cnt,\@results);
}
***************
*** 279,287 ****
################## DEFAULT ##################################
} else { # DEFAULT
! if ($searchfield ne '') {
! $template->param(searchfield => "<p>You Searched for <strong>$searchfield</strong></p>");
! }
my $env;
! my ($count,$results)=StringSearch($env,$searchfield,'web');
my $toggle=0;
my @loop_data = ();
--- 328,336 ----
################## DEFAULT ##################################
} else { # DEFAULT
! #Adding tab management for system preferences
! my $tab=$input->param('tab');
!
my $env;
! my ($count,$results)=StringSearch($env,$searchfield,$tab);
my $toggle=0;
my @loop_data = ();
***************
*** 301,305 ****
push(@loop_data, \%row_data);
}
! $template->param(loop => \@loop_data);
if ($offset>0) {
my $prevpage = $offset-$pagesize;
--- 350,355 ----
push(@loop_data, \%row_data);
}
! $tab=($tab?$tab:"Others");
! $template->param(loop => \@loop_data, $tab => 1);
if ($offset>0) {
my $prevpage = $offset-$pagesize;
More information about the Koha-cvs
mailing list