Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / usage_statistics.tt
index 5819de0..25d5aba 100644 (file)
@@ -1,3 +1,4 @@
+[% USE raw %]
 [% USE Asset %]
 [% SET footerjs = 1 %]
 [% USE Koha %]
@@ -6,7 +7,7 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Administration &rsaquo; Koha usage statistics</title>
 [% INCLUDE 'doc-head-close.inc' %]
-[% Asset.css("lib/leaflet/leaflet.css") %]
+[% Asset.css("lib/leaflet/leaflet.css") | $raw %]
 </head>
 
 <body id="admin_usage_statistics" class="admin">
@@ -21,7 +22,7 @@
     <div class="yui-b">
 
 [% FOR m IN messages %]
-    <div class="dialog [% m.type %]">
+    <div class="dialog [% m.type | html %]">
         [% SWITCH m.code %]
         [% CASE 'error_on_update' %]
             An error occurred when updating this patron category. Perhaps it already exists.
@@ -38,7 +39,7 @@
         [% CASE 'already_exists' %]
             This patron category already exists.
         [% CASE %]
-            [% m.code %]
+            [% m.code | html %]
         [% END %]
     </div>
 [% END %]
                         <option value="">&nbsp;</option>
                         [% FOR country IN countries %]
                             [% IF country == UsageStatsCountry %]
-                                <option value="[% country %]" selected="selected">[% country %]</option>
+                                <option value="[% country | html %]" selected="selected">[% country | html %]</option>
                                 [% SET IsUsageStatsCountryValid = 1 %]
                             [% ELSE %]
-                                <option value="[% country %]">[% country %]</option>
+                                <option value="[% country | html %]">[% country | html %]</option>
                             [% END %]
                         [% END %]
                     </select>
                     [% UNLESS IsUsageStatsCountryValid %]
-                        Note: The value of your system preference 'UsageStatsCountry' is not valid ([% UsageStatsCountry %]).
+                        Note: The value of your system preference 'UsageStatsCountry' is not valid ([% UsageStatsCountry | html %]).
                         Please select a valid one.
                     [% END %]
                 </li>
                 </li>
                 <li>
                     <label for="UsageStatsLibraryUrl">Library URL: </label>
-                    <input type="text" name="UsageStatsLibraryUrl" value="[% Koha.Preference('UsageStatsLibraryUrl') %]" id="UsageStatsLibraryUrl" />
+                    <input type="text" name="UsageStatsLibraryUrl" value="[% Koha.Preference('UsageStatsLibraryUrl') | html %]" id="UsageStatsLibraryUrl" />
                 </li>
                 <li>
                     <span class="label">Last update: </span>
                     [% IF UsageStatsLastUpdateTime %]
-                        [% UsageStatsLastUpdateTime %]
+                        [% UsageStatsLastUpdateTime | html %]
                     [% ELSE %]
                         Your data have never been shared
                     [% END %]
                 </li>
                 <li>
                     <label for="UsageStatsGeolocation">Geolocation: </label>
-                    <input id="UsageStatsGeolocation" name="UsageStatsGeolocation" value="[% Koha.Preference('UsageStatsGeolocation') %]" type="text" value="[% Koha.Preference('UsageStatsLibrariesInfo') %]" size="35" readonly="readonly" />
-                    <a href="#" class="change_geolocation" data-branchname="" data-id="UsageStatsGeolocation"><img src="[% interface %]/lib/leaflet/images/marker-icon.png" title="Set geolocation" style="max-height: 2em;" /></a>
+                    <input id="UsageStatsGeolocation" name="UsageStatsGeolocation" value="[% Koha.Preference('UsageStatsGeolocation') | html %]" type="text" value="[% Koha.Preference('UsageStatsLibrariesInfo') | html %]" size="35" readonly="readonly" />
+                    <a href="#" class="change_geolocation" data-branchname="" data-id="UsageStatsGeolocation"><img src="[% interface | html %]/lib/leaflet/images/marker-icon.png" title="Set geolocation" style="max-height: 2em;" /></a>
                 </li>
                 <li>
                     <label for="UsageStatsLibrariesInfo">Libraries informations: </label>
                     <ol>
                         [% FOR l IN libraries %]
                         <li>
-                            <label for="[% l.branchcode %]">[% l.branchname %]: </label>
+                            <label for="[% l.branchcode | html %]">[% l.branchname | html %]: </label>
                             <div style="float:left;">
-                                <div>Country: [% l.branchcountry %]</div>
-                                <div>Url: [% l.branchurl %]</div>
+                                <div>Country: [% l.branchcountry | html %]</div>
+                                <div>Url: [% l.branchurl | html %]</div>
                                 <div>
-                                    Geolocation: <input type="text" id="geolocation_[% l.branchcode %]" name="geolocation_[% l.branchcode %]" value="[% l.geolocation %]" size="35" readonly="readonly" />
-                                    <a href="#" class="change_geolocation" data-branchname="[% l.branchname %]" data-id="geolocation_[% l.branchcode %]"><img src="[% interface %]/lib/leaflet/images/marker-icon.png" title="Set geolocation for [% l.branchname %]" style="max-height: 2em;" /></a>
+                                    Geolocation: <input type="text" id="geolocation_[% l.branchcode | html %]" name="geolocation_[% l.branchcode | html %]" value="[% l.geolocation | html %]" size="35" readonly="readonly" />
+                                    <a href="#" class="change_geolocation" data-branchname="[% l.branchname | html %]" data-id="geolocation_[% l.branchcode | html %]"><img src="[% interface | html %]/lib/leaflet/images/marker-icon.png" title="Set geolocation for [% l.branchname | html %]" style="max-height: 2em;" /></a>
                                 </div>
                             </div>
                         </li>
                     <label for="MyPublicLink">See your public page: </label>
                     [% IF Koha.Preference('UsageStatsPublicID') %]
                         [% SET my_url = 'https://hea.koha-community.org/libraries/' _  Koha.Preference('UsageStatsPublicID') %]
-                        <a href="[% my_url %]">[% my_url %]</a>
+                        <a href="[% my_url | html %]">[% my_url | html %]</a>
                     [% ELSE %]
                         You do not have anything public yet.
                     [% END %]
 
 [% MACRO jsinclude BLOCK %]
     [% INCLUDE 'calendar.inc' %]
-    [% Asset.js("js/admin-menu.js") %]
-    <script src="[% interface %]/lib/leaflet/leaflet.js"></script>
+    [% Asset.js("js/admin-menu.js") | $raw %]
+    <script src="[% interface | html %]/lib/leaflet/leaflet.js"></script>
     <script type="text/javascript">
         function positionMap() {
             var tbh = $("#mapid");
 
         // Init the map
         [% IF Koha.Preference('UsageStatsGeolocation') %]
-            var latlng = [ [% Koha.Preference('UsageStatsGeolocation') %] ];
+            var latlng = [ [% Koha.Preference('UsageStatsGeolocation') | html %] ];
             add_to_map( current_elt, latlng );
         [% END %]
         [% FOR l IN libraries %]
-            [% NEXT UNLESS l.geolocation %]
-            add_to_map( { 'text': "[% l.branchname %]", 'id': "geolocation_[% l.branchcode %]" }, [ [% l.geolocation %] ] );
+            [% NEXT | html UNLESS l.geolocation %]
+            add_to_map( { 'text': "[% l.branchname | html %]", 'id': "geolocation_[% l.branchcode | html %]" }, [ [% l.geolocation | html %] ] );
         [% END %]
 
         // On click, update the geolocation and the marker