[Koha-patches] [PATCH] Proposed new approach to tab structure for syspref display.

Joe Atzberger joe.atzberger at liblime.com
Thu Dec 18 02:50:28 CET 2008


This reorients the hash as the FIXME comment in the admin/systempreferences.pl script
suggests.  This is not yet integrated into the script, but it demonstrates how I intend
to separate the tab structure from the runtime script itself.  It opens the possibility
of easily swapping in other tab structures.
---
 C4/Sysprefs.pm |  318 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 318 insertions(+), 0 deletions(-)
 create mode 100644 C4/Sysprefs.pm

diff --git a/C4/Sysprefs.pm b/C4/Sysprefs.pm
new file mode 100644
index 0000000..c48f137
--- /dev/null
+++ b/C4/Sysprefs.pm
@@ -0,0 +1,318 @@
+package C4::Sysprefs;
+# This file is part of Koha.
+#
+# 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 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.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use warnings;
+use Carp;
+use C4::Debug;
+use Exporter;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+
+our ($debug, $cgi_debug, %tabs);
+
+BEGIN {
+	$VERSION = 0.04;
+	@ISA = qw(Exporter);
+	@EXPORT_OK = qw();
+}
+
+sub tabs {
+    defined(%tabs) and return \%tabs;
+    %tabs = (
+Acquisitions => [qw(
+    acquisitions
+    gist
+    emailPurchaseSuggestions
+    RenewSerialAddsSuggestion
+)],
+Admin => [qw(
+    singleBranchMode
+    staffClientBaseURL
+    Version
+    OpacMaintenance
+    FrameworksLoaded
+    libraryAddress
+    delimiter
+    IndependantBranches
+    insecure
+    KohaAdmin
+    KohaAdminEmailAddress
+    MIME
+    timeout
+    Intranet_includes
+    AutoLocation
+    DebugLevel
+    SessionStorage
+    noItemTypeImages
+    OPACBaseURL
+    GranularPermissions
+)],
+Authorities => [qw(
+    authoritysep
+    AuthDisplayHierarchy
+    dontmerge
+    BiblioAddsAuthorities
+)],
+Cataloguing => [qw(
+    advancedMARCEditor
+    autoBarcode
+    hide_marc
+    IntranetBiblioDefaultView
+    ISBD
+    itemcallnumber
+    LabelMARCView
+    marc
+    marcflavour
+    MARCOrgCode
+    z3950AuthorAuthFields
+    z3950NormalizeAuthor
+    Stemming
+    WeightFields
+    NoZebra
+    NoZebraIndexes
+    ReceiveBackIssues
+    DefaultClassificationSource
+    RoutingSerials
+    item-level_itypes
+    OpacSuppression
+)],
+Circulation => [qw(
+    maxoutstanding
+    maxreserves
+    noissuescharge
+    IssuingInProcess
+    patronimages
+    printcirculationslips
+    ReturnBeforeExpiry
+    SpecifyDueDate
+    AutomaticItemReturn
+    ReservesMaxPickUpDelay
+    TransfersMaxDaysWarning
+    useDaysMode
+    ReservesNeedReturns
+    CircAutocompl
+    AllowRenewalLimitOverride
+    canreservefromotherbranches
+    finesMode
+    emailLibrarianWhenHoldIsPlaced
+    globalDueDate
+    holdCancelLength
+    itemBarcodeInputFilter
+    WebBasedSelfCheck
+    CircControl
+    finesCalendar
+    previousIssuesDefaultSortOrder
+    todaysIssuesDefaultSortOrder
+    HomeOrHoldingBranch
+    RandomizeHoldsQueueWeight
+    StaticHoldsQueueWeight
+    AllowOnShelfHolds
+    AllowHoldsOnDamagedItems
+)],
+StaffClient => [qw(
+    TemplateEncoding
+    template
+    intranetstylesheet
+    IntranetNav
+    intranetcolorstylesheet
+    intranetuserjs
+    yuipath
+    IntranetmainUserblock
+ )],   
+Patrons => [qw(
+    autoMemberNum
+    checkdigit
+    intranetreadinghistory
+    NotifyBorrowerDeparture
+    memberofinstitution
+    ReadingHistory
+    BorrowerMandatoryField
+    borrowerRelationship
+    BorrowersTitles
+    patronimages
+    MinPasswordLength
+    uppercasesurnames
+    NoReturnSetLost
+    MaxFine
+    NotifyBorrowerDeparture
+    AddPatronLists
+    PatronsPerPage
+    ExtendedPatronAttributes
+    AutoEmailOpacUser
+    AutoEmailPrimaryAddress
+    EnhancedMessagingPreferences
+    SMSSendDriver
+)],
+# I18N/L10N
+I18N => [qw(
+    dateformat
+    opaclanguages
+    opacthemes
+    language
+)],
+Searching => [qw(
+    defaultSortField
+    defaultSortOrder
+    numSearchResults
+    OPACdefaultSortField
+    OPACdefaultSortOrder
+    OPACItemsResultsDisplay
+    OPACnumSearchResults
+    QueryFuzzy
+    QueryStemming
+    QueryWeightFields
+    expandedSearchOption
+    sortbynonfiling
+    QueryAutoTruncate
+    QueryRemoveStopwords
+    AdvancedSearchTypes
+)],
+EnhancedContent => [qw(
+    GoogleJackets
+    AuthorisedValueImages
+   ),
+    {
+    Amazon => [qw(
+        AmazonContent
+        AWSAccessKeyID
+        AmazonLocale
+        AmazonAssocTag
+        AmazonSimilarItems
+        OPACAmazonContent
+        OPACAmazonSimilarItems
+    )],
+    BakerTaylor => [qw(
+        BakerTaylorBookstoreURL
+        BakerTaylorEnabled
+        BakerTaylorPassword
+        BakerTaylorUsername
+    )],
+    FRBR => [qw(
+        FRBRizeEditions
+        XISBN
+        OCLCAffiliateID
+        XISBNDailyLimit
+        PINESISBN
+        ThingISBN
+        OPACFRBRizeEditions
+    )],
+    Tags => [qw(
+        TagsEnabled
+        TagsExternalDictionary
+        TagsInputOnDetail
+        TagsInputOnList
+        TagsShowOnDetail
+        TagsShowOnList
+        TagsModeration
+    )],
+    }
+],
+OPAC => [sort qw(
+    BiblioDefaultView
+    LibraryName
+    opaccolorstylesheet
+    opaccredits
+    opaclayoutstylesheet
+    OpacNav
+    opacsmallimage
+    opacstylesheet
+    opacthemes
+    opacuserjs
+    SubscriptionHistory
+    opacheader
+    noOPACUserLogin
+    hideBiblioNumber
+    OPACDisplayExtendedSubInfo
+    OpacMainUserBlock
+    OPACSubscriptionDisplay
+    OPACURLOpenInNewWindow
+    OPACUserCSS
+    OPACHighlightedWords
+    OPACViewOthersSuggestions
+    URLLinkText
+    OPACShelfBrowser
+    OPACDisplayRequestPriority
+
+    SearchMyLibraryFirst
+    hidelostitems
+    opacbookbag
+    opaclanguagesdisplay
+    OpacPasswordChange
+    opacreadinghistory
+    virtualshelves
+    RequestOnOpac
+    reviewson
+    OpacTopissues
+    OpacAuthorities
+    OpacCloud
+    opacuserlogin
+    AnonSuggestions
+    suggestion
+    OpacTopissue
+    OpacBrowser
+    kohaspsuggest
+    OpacRenewalAllowed
+    OPACItemHolds
+    OPACGroupResults
+    XSLTDetailsDisplay
+    XSLTResultsDisplay
+)],
+Logs => [qw(
+    CataloguingLog
+    BorrowersLog
+    SubscriptionLog
+    IssueLog
+    ReturnLog
+    LetterLog
+    FinesLog
+)],
+'OAI-PMH' => [qw(
+   OAI-PMH
+   OAI-PMH:archiveID
+   OAI-PMH:MaxCount
+   OAI-PMH:Set
+   OAI-PMH:Subset
+)],
+    );
+    return \%tabs;
+}
+
+
+1;
+__END__
+
+=head1 C4::Sysprefs.pm - Separating the tab structure from the interface script.
+
+Note, most of the accessing and manipulation of System Preferences is done in 
+C4::Context.  This is just for the tabs structure in the admin interface.  It is intended 
+to replace the inline code in the admin/systempreferences.pl script.  
+
+=head1 EXAMPLES 
+
+You can see what the tab structure looks like with:
+perl -e 'use Data::Dumper; use C4::Sysprefs; my $t=C4::Sysprefs->tabs; print Dumper($t);'
+
+Or just the Logs section like:
+perl -e 'use Data::Dumper; use C4::Sysprefs; my $t=C4::Sysprefs->tabs; print Dumper($t->{Logs});'
+
+=head1 TO DO
+
+Deeper structure and linking back into other parts of the structure.
+
+Everything else.
+
+=cut
+
-- 
1.5.5.GIT




More information about the Koha-patches mailing list