@@ -, +, @@ statistics --- admin/admin-home.pl | 30 +++++++++- installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/css/staff-global.css | 9 ++- .../prog/en/modules/admin/admin-home.tt | 64 +++++++++++++++++++++ .../prog/en/modules/admin/preferences/admin.pref | 5 ++ koha-tmpl/intranet-tmpl/prog/img/later.png | Bin 0 -> 1359 bytes 6 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/img/later.png --- a/admin/admin-home.pl +++ a/admin/admin-home.pl @@ -22,8 +22,6 @@ use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; - - my $query = new CGI; my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "admin/admin-home.tt", @@ -34,4 +32,32 @@ my ($template, $loggedinuser, $cookie) debug => 1, }); +# +# Usage stats sharing +# +my $usageStats = C4::Context->preference("UsageStats"); +if( $usageStats ){ + $template->param(usageStats => 1); +} +else{ + $template->param(usageStats => 0); +} + +my $DAYS = 7; #Number of days before remind to send usage stats +my $today = DateTime->now->epoch; +my $lastDisplay; +if ( (C4::Context->preference("UsageStatsLastDisplay")) eq "" ){ + $lastDisplay = 1; +} +else{ + $lastDisplay = C4::Context->preference("UsageStatsLastDisplay") / 1000; #milliseconds to seconds +} + +if( ($lastDisplay != 0) && ( $today > ($lastDisplay+ ( 60 * 60 * 24 * $DAYS)) ) ){ + $template->param(lastDisplay => $today); +} +else{ + $template->param(lastDisplay => 0); +} + output_html_with_http_headers $query, $cookie, $template->output; --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -458,6 +458,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('UsageStatsLibraryName', '', NULL, 'The library name to be shown on Hea Koha community website', 'Free'), ('UsageStatsLibraryType', 'public', 'public|school|academic|research|private|societyAssociation|corporate|government|religiousOrg|subscription', 'The library type to be shown on the Hea Koha community website', 'Choice'), ('UsageStatsLibraryUrl', '', NULL, 'The library URL to be shown on Hea Koha community website', 'Free'), +('UsageStatsLastDisplay', '', NULL, 'The last time we propose you to share your statistics', 'Free'), ('UseAuthoritiesForTracings','1','0','Use authority record numbers for subject tracings instead of heading strings.','YesNo'), ('UseBranchTransferLimits','0','','If ON, Koha will will use the rules defined in branch_transfer_limits to decide if an item transfer should be allowed.','YesNo'), ('UseControlNumber','0','','If ON, record control number (w subfields) and control number (001) are used for linking of bibliographic records.','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1098,7 +1098,7 @@ div.first fieldset { background : #FFF none; } -.dialog input.approve, td input.approve { +.dialog input.approve, td input.approve, button.approve { background : #FFF url(../../img/approve.gif) no-repeat 4px center; padding : .4em .4em .4em 25px; } @@ -1107,11 +1107,16 @@ td input.approve { background-color : #FFC; } -.dialog input.deny { +.dialog input.deny, button.deny { background : #FFF url(../../img/deny.gif) no-repeat 4px center; padding : .4em .4em .4em 25px; } +.dialog input.later, button.later { + background : #FFF url(../../img/later.png) no-repeat 4px center; + padding : .4em .4em .4em 25px; + } + .dialog input.save { background: #fff url(../../img/toolbar-save.gif) no-repeat 4px center; color:black; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt @@ -1,6 +1,58 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Administration [% INCLUDE 'doc-head-close.inc' %] + [% INCLUDE 'header.inc' %] @@ -8,6 +60,18 @@ +[% IF !usageStats && lastDisplay %] +
+

You are not sharing statistics with the community yet:

+

Please share them to help us improve your user experience.

+

We are sharing data anonymously, please see which data are sent here.

+

Send stats monthly ?

+ + + +
+[% END %] +
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -164,3 +164,8 @@ Administration: subscription: "subscription" - will be shown on the Hea Koha community website. - Note that this value has no effect if the UsageStats system preference is set to "Don't share" + + - + - We offered you on + - pref: UsageStatsLastDisplay + - to share your statistics with the community on the Hea Koha community website.