-$tabsysprefs{acquisitions}="Acquisitions";
-$tabsysprefs{gist}="Acquisitions";
-$tabsysprefs{authoritysep}="Authorities";
-$tabsysprefs{ISBD}="Catalogue";
-$tabsysprefs{marc}="Catalogue";
-$tabsysprefs{autoBarcode}="Catalogue";
-$tabsysprefs{marcflavour}="Catalogue";
-$tabsysprefs{SubscriptionHistory}="OPAC";
-$tabsysprefs{maxoutstanding}="Circulation";
-$tabsysprefs{printcirculationslips}="Circulation";
-$tabsysprefs{ReturnBeforeExpiry}="Circulation";
-$tabsysprefs{suggestion}="OPAC";
-$tabsysprefs{automembernum}="Members";
-$tabsysprefs{noissuescharge}="Circulation";
-$tabsysprefs{opacthemes}="OPAC";
-$tabsysprefs{opaclanguages}="OPAC";
-$tabsysprefs{LibraryName}="OPAC";
-$tabsysprefs{opacstylesheet}="OPAC";
-$tabsysprefs{BiblioDefaultView}="OPAC";
-$tabsysprefs{opaclargeimage}="OPAC";
-$tabsysprefs{opacsmallimage}="OPAC";
-$tabsysprefs{hidelostitems}="OPAC";
-$tabsysprefs{KohaAdmin}="Admin";
-$tabsysprefs{checkdigit}="Members";
-$tabsysprefs{dateformat}="Admin";
-$tabsysprefs{insecure}="Admin";
-$tabsysprefs{ldapinfos}="Admin";
-$tabsysprefs{ldapserver}="Admin";
-$tabsysprefs{itemcallnumber}="Catalogue";
-$tabsysprefs{maxreserves}="Circulation";
-$tabsysprefs{virtualshelves}="OPAC";
-$tabsysprefs{hide_marc}="Catalogue";
-$tabsysprefs{NotifyBorrowerDeparture}="Members";
-$tabsysprefs{OpacPasswordChange}="OPAC";
-
-sub StringSearch {
- my ($env,$searchstring,$type)=@_;
- my $dbh = C4::Context->dbh;
- $searchstring=~ s/\'/\\\'/g;
- 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);
+
+# Acquisitions
+$tabsysprefs{acquisitions} = "Acquisitions";
+$tabsysprefs{gist} = "Acquisitions";
+$tabsysprefs{emailPurchaseSuggestions} = "Acquisitions";
+
+# Admin
+$tabsysprefs{singleBranchMode} = "Admin";
+$tabsysprefs{staffClientBaseURL} = "Admin";
+$tabsysprefs{Version} = "Admin";
+$tabsysprefs{OpacMaintenance} = "Admin";
+$tabsysprefs{FrameworksLoaded} = "Admin";
+$tabsysprefs{libraryAddress} = "Admin";
+$tabsysprefs{delimiter} = "Admin";
+$tabsysprefs{IndependantBranches} = "Admin";
+$tabsysprefs{insecure} = "Admin";
+$tabsysprefs{KohaAdmin} = "Admin";
+$tabsysprefs{KohaAdminEmailAddress} = "Admin";
+$tabsysprefs{MIME} = "Admin";
+$tabsysprefs{timeout} = "Admin";
+$tabsysprefs{Intranet_includes} = "Admin";
+$tabsysprefs{AutoLocation} = "Admin";
+$tabsysprefs{DebugLevel} = "Admin";
+$tabsysprefs{SessionStorage} = "Admin";
+$tabsysprefs{noItemTypeImages} = "Admin";
+$tabsysprefs{OPACBaseURL} = "Admin";
+$tabsysprefs{GranularPermissions} = "Admin";
+
+# Authorities
+$tabsysprefs{authoritysep} = "Authorities";
+$tabsysprefs{AuthDisplayHierarchy} = "Authorities";
+$tabsysprefs{dontmerge} = "Authorities";
+$tabsysprefs{BiblioAddsAuthorities} = "Authorities";
+
+# Cataloguing
+$tabsysprefs{advancedMARCeditor} = "Cataloging";
+$tabsysprefs{autoBarcode} = "Cataloging";
+$tabsysprefs{hide_marc} = "Cataloging";
+$tabsysprefs{IntranetBiblioDefaultView} = "Cataloging";
+$tabsysprefs{ISBD} = "Cataloging";
+$tabsysprefs{itemcallnumber} = "Cataloging";
+$tabsysprefs{LabelMARCView} = "Cataloging";
+$tabsysprefs{marc} = "Cataloging";
+$tabsysprefs{marcflavour} = "Cataloging";
+$tabsysprefs{MARCOrgCode} = "Cataloging";
+$tabsysprefs{z3950AuthorAuthFields} = "Cataloging";
+$tabsysprefs{z3950NormalizeAuthor} = "Cataloging";
+$tabsysprefs{Stemming} = "Cataloging";
+$tabsysprefs{WeightFields} = "Cataloging";
+$tabsysprefs{NoZebra} = "Cataloging";
+$tabsysprefs{NoZebraIndexes} = "Cataloging";
+$tabsysprefs{ReceiveBackIssues} = "Cataloging";
+$tabsysprefs{DefaultClassificationSource} = "Cataloging";
+$tabsysprefs{RoutingSerials} = "Cataloging";
+$tabsysprefs{'item-level_itypes'} = "Cataloging";
+$tabsysprefs{OpacSuppression} = "Cataloging";
+
+# Circulation
+$tabsysprefs{maxoutstanding} = "Circulation";
+$tabsysprefs{maxreserves} = "Circulation";
+$tabsysprefs{noissuescharge} = "Circulation";
+$tabsysprefs{IssuingInProcess} = "Circulation";
+$tabsysprefs{patronimages} = "Circulation";
+$tabsysprefs{printcirculationslips} = "Circulation";
+$tabsysprefs{ReturnBeforeExpiry} = "Circulation";
+$tabsysprefs{SpecifyDueDate} = "Circulation";
+$tabsysprefs{AutomaticItemReturn} = "Circulation";
+$tabsysprefs{ReservesMaxPickUpDelay} = "Circulation";
+$tabsysprefs{TransfersMaxDaysWarning} = "Circulation";
+$tabsysprefs{useDaysMode} = "Circulation";
+$tabsysprefs{ReservesNeedReturns} = "Circulation";
+$tabsysprefs{CircAutocompl} = "Circulation";
+$tabsysprefs{AllowRenewalLimitOverride} = "Circulation";
+$tabsysprefs{canreservefromotherbranches} = "Circulation";
+$tabsysprefs{finesMode} = "Circulation";
+$tabsysprefs{emailLibrarianWhenHoldIsPlaced} = "Circulation";
+$tabsysprefs{globalDueDate} = "Circulation";
+$tabsysprefs{holdCancelLength} = "Circulation";
+$tabsysprefs{itemBarcodeInputFilter} = "Circulation";
+$tabsysprefs{WebBasedSelfCheck} = "Circulation";
+$tabsysprefs{CircControl} = "Circulation";
+$tabsysprefs{finesCalendar} = "Circulation";
+$tabsysprefs{previousIssuesDefaultSortOrder} = "Circulation";
+$tabsysprefs{todaysIssuesDefaultSortOrder} = "Circulation";
+$tabsysprefs{HomeOrHoldingBranch} = "Circulation";
+$tabsysprefs{RandomizeHoldsQueueWeight} = "Circulation";
+$tabsysprefs{StaticHoldsQueueWeight} = "Circulation";
+$tabsysprefs{AllowOnShelfHolds} = "Circulation";
+$tabsysprefs{AllowHoldsOnDamagedItems} = "Circulation";
+
+# Staff Client
+$tabsysprefs{TemplateEncoding} = "StaffClient";
+$tabsysprefs{template} = "StaffClient";
+$tabsysprefs{intranetstylesheet} = "StaffClient";
+$tabsysprefs{IntranetNav} = "StaffClient";
+$tabsysprefs{intranetcolorstylesheet} = "StaffClient";
+$tabsysprefs{intranetuserjs} = "StaffClient";
+$tabsysprefs{yuipath} = "StaffClient";
+$tabsysprefs{IntranetmainUserblock} = "StaffClient";
+
+# Patrons
+$tabsysprefs{autoMemberNum} = "Patrons";
+$tabsysprefs{checkdigit} = "Patrons";
+$tabsysprefs{intranetreadinghistory} = "Patrons";
+$tabsysprefs{NotifyBorrowerDeparture} = "Patrons";
+$tabsysprefs{memberofinstitution} = "Patrons";
+$tabsysprefs{ReadingHistory} = "Patrons";
+$tabsysprefs{BorrowerMandatoryField} = "Patrons";
+$tabsysprefs{borrowerRelationship} = "Patrons";
+$tabsysprefs{BorrowersTitles} = "Patrons";
+$tabsysprefs{patronimages} = "Patrons";
+$tabsysprefs{minPasswordLength} = "Patrons";
+$tabsysprefs{uppercasesurnames} = "Patrons";
+$tabsysprefs{MaxFine} = "Patrons";
+$tabsysprefs{NotifyBorrowerDeparture} = "Patrons";
+$tabsysprefs{AddPatronLists} = "Patrons";
+$tabsysprefs{PatronsPerPage} = "Patrons";
+$tabsysprefs{ExtendedPatronAttributes} = "Patrons";
+$tabsysprefs{AutoEmailOpacUser} = "Patrons";
+$tabsysprefs{AutoEmailPrimaryAddress} = "Patrons";
+$tabsysprefs{EnhancedMessagingPreferences} = "Patrons";
+$tabsysprefs{'SMSSendDriver'} = 'Patrons';
+
+# I18N/L10N
+$tabsysprefs{dateformat} = "I18N/L10N";
+$tabsysprefs{opaclanguages} = "I18N/L10N";
+$tabsysprefs{opaclanguagesdisplay} = "I18N/L10N";
+$tabsysprefs{language} = "I18N/L10N";
+
+# Searching
+$tabsysprefs{defaultSortField} = "Searching";
+$tabsysprefs{defaultSortOrder} = "Searching";
+$tabsysprefs{numSearchResults} = "Searching";
+$tabsysprefs{OPACdefaultSortField} = "Searching";
+$tabsysprefs{OPACdefaultSortOrder} = "Searching";
+$tabsysprefs{OPACItemsResultsDisplay} = "Searching";
+$tabsysprefs{OPACnumSearchResults} = "Searching";
+$tabsysprefs{QueryFuzzy} = "Searching";
+$tabsysprefs{QueryStemming} = "Searching";
+$tabsysprefs{QueryWeightFields} = "Searching";
+$tabsysprefs{expandedSearchOption} = "Searching";
+$tabsysprefs{sortbynonfiling} = "Searching";
+$tabsysprefs{QueryAutoTruncate} = "Searching";
+$tabsysprefs{QueryRemoveStopwords} = "Searching";
+$tabsysprefs{AdvancedSearchTypes} = "Searching";
+
+# EnhancedContent
+$tabsysprefs{AmazonContent} = "EnhancedContent";
+$tabsysprefs{AWSAccessKeyID} = "EnhancedContent";
+$tabsysprefs{AWSPrivateKey} = "EnhancedContent";
+$tabsysprefs{AmazonLocale} = "EnhancedContent";
+$tabsysprefs{AmazonAssocTag} = "EnhancedContent";
+$tabsysprefs{AmazonSimilarItems} = "EnhancedContent";
+$tabsysprefs{OPACAmazonContent} = "EnhancedContent";
+$tabsysprefs{OPACAmazonSimilarItems} = "EnhancedContent";
+
+# Baker & Taylor
+$tabsysprefs{BakerTaylorBookstoreURL} = 'EnhancedContent';
+$tabsysprefs{BakerTaylorEnabled} = 'EnhancedContent';
+$tabsysprefs{BakerTaylorPassword} = 'EnhancedContent';
+$tabsysprefs{BakerTaylorUsername} = 'EnhancedContent';
+
+# FRBR
+$tabsysprefs{FRBRizeEditions} = "EnhancedContent";
+$tabsysprefs{XISBN} = "EnhancedContent";
+$tabsysprefs{OCLCAffiliateID} = "EnhancedContent";
+$tabsysprefs{XISBNDailyLimit} = "EnhancedContent";
+$tabsysprefs{PINESISBN} = "EnhancedContent";
+$tabsysprefs{ThingISBN} = "EnhancedContent";
+$tabsysprefs{OPACFRBRizeEditions} = "EnhancedContent";
+
+# Tags
+$tabsysprefs{TagsEnabled} = 'EnhancedContent';
+$tabsysprefs{TagsExternalDictionary} = 'EnhancedContent';
+$tabsysprefs{TagsInputOnDetail} = 'EnhancedContent';
+$tabsysprefs{TagsInputOnList} = 'EnhancedContent';
+$tabsysprefs{TagsShowOnDetail} = 'EnhancedContent';
+$tabsysprefs{TagsShowOnList} = 'EnhancedContent';
+$tabsysprefs{TagsModeration} = 'EnhancedContent';
+$tabsysprefs{GoogleJackets} = 'EnhancedContent';
+$tabsysprefs{AuthorisedValueImages} = "EnhancedContent";
+
+# OPAC
+$tabsysprefs{BiblioDefaultView} = "OPAC";
+$tabsysprefs{LibraryName} = "OPAC";
+$tabsysprefs{opaccolorstylesheet} = "OPAC";
+$tabsysprefs{opaccredits} = "OPAC";
+$tabsysprefs{opaclayoutstylesheet} = "OPAC";
+$tabsysprefs{OpacNav} = "OPAC";
+$tabsysprefs{opacsmallimage} = "OPAC";
+$tabsysprefs{opacstylesheet} = "OPAC";
+$tabsysprefs{opacthemes} = "OPAC";
+$tabsysprefs{opacuserjs} = "OPAC";
+$tabsysprefs{opacheader} = "OPAC";
+$tabsysprefs{hideBiblioNumber} = "OPAC";
+$tabsysprefs{OpacMainUserBlock} = "OPAC";
+$tabsysprefs{OPACURLOpenInNewWindow} = "OPAC";
+$tabsysprefs{OPACUserCSS} = "OPAC";
+$tabsysprefs{OPACHighlightedWords} = "OPAC";
+$tabsysprefs{OPACViewOthersSuggestions} = "OPAC";
+$tabsysprefs{URLLinkText} = "OPAC";
+$tabsysprefs{OPACShelfBrowser} = "OPAC";
+$tabsysprefs{OPACDisplayRequestPriority} = "OPAC";
+
+# OPAC
+$tabsysprefs{SearchMyLibraryFirst} = "OPAC";
+$tabsysprefs{hidelostitems} = "OPAC";
+$tabsysprefs{opacbookbag} = "OPAC";
+$tabsysprefs{OpacPasswordChange} = "OPAC";
+$tabsysprefs{opacreadinghistory} = "OPAC";
+$tabsysprefs{virtualshelves} = "OPAC";
+$tabsysprefs{RequestOnOpac} = "OPAC";
+$tabsysprefs{reviewson} = "OPAC";
+$tabsysprefs{OpacTopissues} = "OPAC";
+$tabsysprefs{OpacAuthorities} = "OPAC";
+$tabsysprefs{OpacCloud} = "OPAC";
+$tabsysprefs{opacuserlogin} = "OPAC";
+$tabsysprefs{AnonSuggestions} = "OPAC";
+$tabsysprefs{suggestion} = "OPAC";
+$tabsysprefs{OpacTopissue} = "OPAC";
+$tabsysprefs{OpacBrowser} = "OPAC";
+$tabsysprefs{kohaspsuggest} = "OPAC";
+$tabsysprefs{OpacRenewalAllowed} = "OPAC";
+$tabsysprefs{OPACItemHolds} = "OPAC";
+$tabsysprefs{OPACGroupResults} = "OPAC";
+$tabsysprefs{XSLTDetailsDisplay} = "OPAC";
+$tabsysprefs{XSLTResultsDisplay} = "OPAC";
+
+# Serials
+$tabsysprefs{OPACSerialIssueDisplayCount} = "Serials";
+$tabsysprefs{StaffSerialIssueDisplayCount} = "Serials";
+$tabsysprefs{OPACDisplayExtendedSubInfo} = "Serials";
+$tabsysprefs{OPACSubscriptionDisplay} = "Serials";
+$tabsysprefs{RenewSerialAddsSuggestion} = "Serials";
+$tabsysprefs{SubscriptionHistory} = "Serials";
+
+# LOGFeatures
+$tabsysprefs{CataloguingLog} = "Logs";
+$tabsysprefs{BorrowersLog} = "Logs";
+$tabsysprefs{SubscriptionLog} = "Logs";
+$tabsysprefs{IssueLog} = "Logs";
+$tabsysprefs{ReturnLog} = "Logs";
+$tabsysprefs{LetterLog} = "Logs";
+$tabsysprefs{FinesLog} = "Logs";
+
+# OAI-PMH variables
+$tabsysprefs{'OAI-PMH'} = "OAI-PMH";
+$tabsysprefs{'OAI-PMH:archiveID'} = "OAI-PMH";
+$tabsysprefs{'OAI-PMH:MaxCount'} = "OAI-PMH";
+$tabsysprefs{'OAI-PMH:Set'} = "OAI-PMH";
+$tabsysprefs{'OAI-PMH:Subset'} = "OAI-PMH";
+
+sub StringSearch {
+ my ( $searchstring, $type ) = @_;
+ my $dbh = C4::Context->dbh;
+ $searchstring =~ s/\'/\\\'/g;
+ my @data = split( ' ', $searchstring );
+ my $count = @data;
+ my @results;
+ my $cnt = 0;
+ my $sth;
+
+ # used for doing a plain-old sys-pref search
+ if ( $type && $type ne 'all' ) {
+ foreach my $syspref ( sort { lc $a cmp lc $b } 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 ) {
+ $data->{shortvalue} = $data->{value};
+ $data->{shortvalue} = substr( $data->{value}, 0, 60 ) . "..." if defined( $data->{value} ) and length( $data->{value} ) > 60;
+ push( @results, $data );
+ $cnt++;
+ }
+ $sth->finish;
+ }
+ }
+ } else {
+ my $sth;
+
+ if ( $type and $type eq 'all' ) {
+ $sth = $dbh->prepare( "
+ SELECT *
+ FROM systempreferences
+ WHERE variable LIKE ? OR explanation LIKE ?
+ ORDER BY VARIABLE" );
+ $sth->execute( "%$searchstring%", "%$searchstring%" );
+ } 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";
+ $sth = $dbh->prepare($strsth);
+ $sth->execute();
+ }
+
+ while ( my $data = $sth->fetchrow_hashref ) {
+ $data->{shortvalue} = $data->{value};
+ $data->{shortvalue} = substr( $data->{value}, 0, 60 ) . "..." if length( $data->{value} ) > 60;
+ push( @results, $data );
+ $cnt++;
+ }
+
+ $sth->finish;
+ }
+ return ( $cnt, \@results );