Lines 2-7
Link Here
|
2 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
3 |
<title>Koha › Administration</title> |
3 |
<title>Koha › Administration</title> |
4 |
[% INCLUDE 'doc-head-close.inc' %] |
4 |
[% INCLUDE 'doc-head-close.inc' %] |
|
|
5 |
<script type="text/javascript"> |
6 |
|
7 |
function hide_message(){ |
8 |
$('.dialog:visible').hide('slow'); |
9 |
} |
10 |
|
11 |
function message_success(){ |
12 |
var button = $('<button>') |
13 |
.attr('type', 'button') |
14 |
.addClass('approve') |
15 |
.html('Ok') |
16 |
.click(hide_message); |
17 |
|
18 |
$('#activate_UsageStats').html( |
19 |
'Usage statistics will be send.' |
20 |
+'<br>If you want to see the statistics generated, go to <a href="http://hea.koha-community.org">hea.koha-community.org</a>' |
21 |
+'<br>' |
22 |
).append(button); |
23 |
|
24 |
} |
25 |
|
26 |
function set_syspref_ajax(syspref, sysvalue){ |
27 |
return $.ajax({ |
28 |
url: '/cgi-bin/koha/svc/config/systempreferences/'+syspref, |
29 |
data: { value: sysvalue }, |
30 |
type: 'POST', |
31 |
}); |
32 |
} |
33 |
|
34 |
(function($) { |
35 |
$(document).ready(function(){ |
36 |
|
37 |
$('#activate_UsageStats button').click(function(){ |
38 |
var jqXHR; |
39 |
if ($(this).hasClass('approve')) { |
40 |
jqXHR = set_syspref_ajax('UsageStats', 1); |
41 |
jqXHR = set_syspref_ajax('UsageStatsLastDisplay', 0); |
42 |
jqXHR.done(message_success); |
43 |
} else if ($(this).hasClass('later')) { |
44 |
jqXHR = set_syspref_ajax('UsageStats', 0); |
45 |
jqXHR = set_syspref_ajax('UsageStatsLastDisplay', Date.now()); |
46 |
jqXHR.done(hide_message); |
47 |
} else if ($(this).hasClass('deny')) { |
48 |
jqXHR = set_syspref_ajax('UsageStats', 0); |
49 |
jqXHR = set_syspref_ajax('UsageStatsLastDisplay', 0); |
50 |
jqXHR.done(hide_message); |
51 |
} |
52 |
}); |
53 |
}); |
54 |
})(jQuery); |
55 |
|
56 |
</script> |
5 |
</head> |
57 |
</head> |
6 |
<body id="admin_admin-home" class="admin"> |
58 |
<body id="admin_admin-home" class="admin"> |
7 |
[% INCLUDE 'header.inc' %] |
59 |
[% INCLUDE 'header.inc' %] |
Lines 9-14
Link Here
|
9 |
|
61 |
|
10 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Administration</div> |
62 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Administration</div> |
11 |
|
63 |
|
|
|
64 |
[% IF !usageStats && lastDisplay %] |
65 |
<div id="activate_UsageStats" class="dialog message"> |
66 |
<h3>You are not sharing statistics with the community yet:</h3> |
67 |
<p>Please share them to help us improve your user experience.</p> |
68 |
<p>We are sharing data anonymously, please see which data are sent <a href="http://wiki.koha-community.org/wiki/KohaUsageStat_RFC">here</a>.</p> |
69 |
<h4><strong>Send stats monthly ?</strong></h4> |
70 |
<button type="button" class="approve"><i class="fa fa-check"></i> Yes, I want to share my statistics</button> |
71 |
<button type="button" class="later"><i class="fa fa-clock-o"></i> Later</button> |
72 |
<button type="button" class="deny"><i class="fa fa-ban"></i> No, I don't want to share my statistics</button> |
73 |
</div> |
74 |
[% END %] |
75 |
|
12 |
<div id="doc" class="yui-t7"> |
76 |
<div id="doc" class="yui-t7"> |
13 |
<div id="bd"> |
77 |
<div id="bd"> |
14 |
<div id="yui-main" class="sysprefs"> |
78 |
<div id="yui-main" class="sysprefs"> |