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;
}
# 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
casLogout
AllowPKIAuth
DebugLevel
- delimiter
+ CSVDelimiter
noItemTypeImages
+ OpacNoItemTypeImages
virtualshelves
AutoLocation
IndependentBranches
Persona
AuthDisplayHierarchy
AutoCreateAuthorities
- BiblioAddsAuthorities
+ AutoLinkBiblios
+ RequireChoosingExistingAuthority
AuthorityMergeLimit
AuthorityMergeMode
UseAuthoritiesForTracings
AgeRestrictionOverride
AllFinesNeedOverride
AllowFineOverride
- AllowItemsOnHoldCheckout
+ AllowItemsOnHoldCheckoutSIP
AllowItemsOnHoldCheckoutSCO
AllowNotForLoanOverride
AllowRenewalLimitOverride
ReturnBeforeExpiry
TransfersMaxDaysWarning
UseBranchTransferLimits
- useDaysMode
UseTransportCostMatrix
UseCourseReserves
finesCalendar
WhenLostChargeReplacementFee
WhenLostForgiveFine
AllowHoldDateInFuture
+ AllowHoldItemTypeSelection
AllowHoldPolicyOverride
AllowHoldsOnDamagedItems
AllowHoldsOnPatronsPossessions
TransferWhenCancelAllWaitingHolds
AllowAllMessageDeletion
AllowOfflineCirculation
- CircAutocompl
+ PatronAutoComplete
CircAutoPrintQuickSlip
DisplayClearScreenButton
FilterBeforeOverdueReport
UpdateTotalIssuesOnCirc
UseTablesortForCirc
WaitingNotifyAtCheckin
- AllowSelfCheckReturns
+ SCOAllowCheckin
AutoSelfCheckAllowed
FRBRizeEditions
OPACFRBRizeEditions
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
OpacTopissue
opacuserlogin
QuoteOfTheDay
- RequestOnOpac
- reviewson
+ OPACHoldRequests
+ OPACComments
ShowReviewer
ShowReviewerPhoto
SocialNetworks
suggestion
- AllowPurchaseSuggestionBranchChoice
OpacAllowPublicListCreation
OpacAllowSharingPrivateLists
OpacRenewalAllowed
TrackClicks
PatronSelfRegistration
OPACShelfBrowser
- AutoEmailOpacUser
+ AutoEmailNewUser
AutoEmailPrimaryAddress
autoMemberNum
BorrowerRenewalPeriodBase
TalkingTechItivaPhoneNotification
uppercasesurnames
IncludeSeeFromInSearches
- OpacGroupResults
QueryAutoTruncate
QueryFuzzy
QueryStemming
QueryWeightFields
TraceCompleteSubfields
TraceSubjectSubdivisions
- UseICU
- UseQueryParser
+ UseICUStyleQuotes
defaultSortField
displayFacetCount
OPACdefaultSortField
- OPACItemsResultsDisplay
expandedSearchOption
IntranetNumbersPreferPhrase
OPACNumbersPreferPhrase
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