Bug 12758: Introduce Koha::XSLT::HTTPS
[koha-ffzg.git] / C4 / UsageStats.pm
index f205767..7cf2098 100644 (file)
@@ -19,9 +19,9 @@ package C4::UsageStats;
 
 use Modern::Perl;
 use C4::Context;
-use POSIX qw(strftime);
+use POSIX qw( strftime );
 use LWP::UserAgent;
-use JSON;
+use JSON qw( decode_json encode_json );
 
 use Koha::Libraries;
 
@@ -87,8 +87,52 @@ sub BuildReport {
     }
 
     # Get systempreferences.
-    foreach (
-        qw/
+    foreach ( @{ _shared_preferences() } )
+    {
+        $report->{systempreferences}{$_} = C4::Context->preference($_);
+    }
+    return $report;
+}
+
+=head2 ReportToCommunity
+
+  ReportToCommunity;
+
+Send to hea.koha-community.org database informations
+
+=cut
+
+sub ReportToCommunity {
+    my $data = shift;
+    my $json = encode_json($data);
+
+    my $url = "https://hea.koha-community.org/upload.pl";
+    my $ua = LWP::UserAgent->new;
+    my $res = $ua->post(
+        $url,
+        'Content-type' => 'application/json;charset=utf-8',
+        Content => $json,
+    );
+    my $content = decode_json( $res->decoded_content );
+    if ( $content->{koha_id} ) {
+        C4::Context->set_preference( 'UsageStatsID', $content->{koha_id} );
+    }
+    if ( $content->{id} ) {
+        C4::Context->set_preference( 'UsageStatsPublicID', $content->{id} );
+    }
+}
+
+=head2 _shared_preferences
+
+    my $preferences = C4::UsageStats::_shared_preferences
+
+Returns an I<arreyref> with the system preferences to be shared.
+
+=cut
+
+sub _shared_preferences {
+
+    my @preferences = qw/
         AcqCreateItem
         AcqWarnOnDuplicateInvoice
         AcqViewBaskets
@@ -98,8 +142,9 @@ sub BuildReport {
         casLogout
         AllowPKIAuth
         DebugLevel
-        delimiter
+        CSVDelimiter
         noItemTypeImages
+        OpacNoItemTypeImages
         virtualshelves
         AutoLocation
         IndependentBranches
@@ -107,7 +152,8 @@ sub BuildReport {
         Persona
         AuthDisplayHierarchy
         AutoCreateAuthorities
-        BiblioAddsAuthorities
+        AutoLinkBiblios
+        RequireChoosingExistingAuthority
         AuthorityMergeLimit
         AuthorityMergeMode
         UseAuthoritiesForTracings
@@ -134,7 +180,7 @@ sub BuildReport {
         AgeRestrictionOverride
         AllFinesNeedOverride
         AllowFineOverride
-        AllowItemsOnHoldCheckout
+        AllowItemsOnHoldCheckoutSIP
         AllowItemsOnHoldCheckoutSCO
         AllowNotForLoanOverride
         AllowRenewalLimitOverride
@@ -154,7 +200,6 @@ sub BuildReport {
         ReturnBeforeExpiry
         TransfersMaxDaysWarning
         UseBranchTransferLimits
-        useDaysMode
         UseTransportCostMatrix
         UseCourseReserves
         finesCalendar
@@ -164,6 +209,7 @@ sub BuildReport {
         WhenLostChargeReplacementFee
         WhenLostForgiveFine
         AllowHoldDateInFuture
+        AllowHoldItemTypeSelection
         AllowHoldPolicyOverride
         AllowHoldsOnDamagedItems
         AllowHoldsOnPatronsPossessions
@@ -182,7 +228,7 @@ sub BuildReport {
         TransferWhenCancelAllWaitingHolds
         AllowAllMessageDeletion
         AllowOfflineCirculation
-        CircAutocompl
+        PatronAutoComplete
         CircAutoPrintQuickSlip
         DisplayClearScreenButton
         FilterBeforeOverdueReport
@@ -197,7 +243,7 @@ sub BuildReport {
         UpdateTotalIssuesOnCirc
         UseTablesortForCirc
         WaitingNotifyAtCheckin
-        AllowSelfCheckReturns
+        SCOAllowCheckin
         AutoSelfCheckAllowed
         FRBRizeEditions
         OPACFRBRizeEditions
@@ -207,33 +253,29 @@ sub BuildReport {
         BakerTaylorEnabled
         GoogleJackets
         HTML5MediaEnabled
-        IDreamBooksReadometer
-        IDreamBooksResults
-        IDreamBooksReviews
         LibraryThingForLibrariesEnabled
         LocalCoverImages
         OPACLocalCoverImages
         NovelistSelectEnabled
         OpenLibraryCovers
         OpenLibrarySearch
-        UseKohaPlugins
         SyndeticsEnabled
         TagsEnabled
         CalendarFirstDayOfWeek
         opaclanguagesdisplay
+        AcquisitionLog
         AuthoritiesLog
         BorrowersLog
         CataloguingLog
         FinesLog
         IssueLog
-        LetterLog
+        ClaimsLog
         ReturnLog
         SubscriptionLog
         BiblioDefaultView
         COinSinOPACResults
         DisplayOPACiconsXSLT
         hidelostitems
-        HighlightOwnItemsOnOPAC
         OpacAddMastheadLibraryPulldown
         OPACDisplay856uAsImage
         OpacHighlightedWords
@@ -264,13 +306,12 @@ sub BuildReport {
         OpacTopissue
         opacuserlogin
         QuoteOfTheDay
-        RequestOnOpac
-        reviewson
+        OPACHoldRequests
+        OPACComments
         ShowReviewer
         ShowReviewerPhoto
         SocialNetworks
         suggestion
-        AllowPurchaseSuggestionBranchChoice
         OpacAllowPublicListCreation
         OpacAllowSharingPrivateLists
         OpacRenewalAllowed
@@ -284,7 +325,7 @@ sub BuildReport {
         TrackClicks
         PatronSelfRegistration
         OPACShelfBrowser
-        AutoEmailOpacUser
+        AutoEmailNewUser
         AutoEmailPrimaryAddress
         autoMemberNum
         BorrowerRenewalPeriodBase
@@ -296,19 +337,16 @@ sub BuildReport {
         TalkingTechItivaPhoneNotification
         uppercasesurnames
         IncludeSeeFromInSearches
-        OpacGroupResults
         QueryAutoTruncate
         QueryFuzzy
         QueryStemming
         QueryWeightFields
         TraceCompleteSubfields
         TraceSubjectSubdivisions
-        UseICU
-        UseQueryParser
+        UseICUStyleQuotes
         defaultSortField
         displayFacetCount
         OPACdefaultSortField
-        OPACItemsResultsDisplay
         expandedSearchOption
         IntranetNumbersPreferPhrase
         OPACNumbersPreferPhrase
@@ -330,40 +368,9 @@ sub BuildReport {
         ILS-DI
         OAI-PMH
         version
-        /
-      )
-    {
-        $report->{systempreferences}{$_} = C4::Context->preference($_);
-    }
-    return $report;
-}
-
-=head2 ReportToCommunity
-
-  ReportToCommunity;
-
-Send to hea.koha-community.org database informations
-
-=cut
+        /;
 
-sub ReportToCommunity {
-    my $data = shift;
-    my $json = encode_json($data);
-
-    my $url = "https://hea.koha-community.org/upload.pl";
-    my $ua = LWP::UserAgent->new;
-    my $res = $ua->post(
-        $url,
-        'Content-type' => 'application/json;charset=utf-8',
-        Content => $json,
-    );
-    my $content = decode_json( $res->decoded_content );
-    if ( $content->{koha_id} ) {
-        C4::Context->set_preference( 'UsageStatsID', $content->{koha_id} );
-    }
-    if ( $content->{id} ) {
-        C4::Context->set_preference( 'UsageStatsPublicID', $content->{id} );
-    }
+    return \@preferences;
 }
 
 =head2 _count