Bug 24163: (QA follow-up) Fix wordings
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / csv-profiles.tt
index 181eb35..675d8cc 100644 (file)
@@ -1,28 +1,9 @@
-[% INCLUDE 'doc-head-open.inc' %]<title>Koha &rsaquo; Tools &rsaquo; CSV export profiles</title>[% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript">
-//<![CDATA[
-function reloadPage(p) {
-    var id = p.value;
-    if (id != 0) { document.location = "/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&amp;export_format_id=" + id; }
-}
-     $(document).ready(function() {
-        $("#type").change(function(){
-            if ( $(this).find("option:selected").val() == "marc" ) {
-                $("li.marc_specific").show();
-                $("#marc_content").attr("required", "required");
-                $("li.sql_specific").hide();
-                $("#sql_content").removeAttr("required");
-            } else {
-                $("li.marc_specific").hide();
-                $("#marc_content").removeAttr("required");
-                $("li.sql_specific").show();
-                $("#sql_content").attr("required", "required");
-            }
-        });
-        $("#type").change();
-     });
-//]]>
-</script>
+[% USE raw %]
+[% USE Asset %]
+[% SET footerjs = 1 %]
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha &rsaquo; Tools &rsaquo; CSV export profiles</title>
+[% INCLUDE 'doc-head-close.inc' %]
 </head>
 
 <body id="tools_csv-profiles" class="tools">
@@ -35,13 +16,13 @@ function reloadPage(p) {
     &rsaquo; CSV export profiles
 </div>
 
-<div id="doc3" class="yui-t2">
-   <div id="bd">
-    <div id="yui-main">
-    <div class="yui-b">
+<div class="main container-fluid">
+    <div class="row">
+        <div class="col-sm-10 col-sm-push-2">
+            <main>
 
 [% 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 CSV profile. Perhaps it already exists.
@@ -58,7 +39,7 @@ function reloadPage(p) {
         [% CASE 'already_exists' %]
             This CSV profile already exists.
         [% CASE %]
-            [% m.code %]
+            [% m.code | html %]
         [% END %]
     </div>
 [% END %]
@@ -111,7 +92,9 @@ function reloadPage(p) {
 [% BLOCK used_for_description %]
     [% IF used_for_code == 'export_records' %] Export records
     [% ELSIF used_for_code == 'late_issues' %] Late serial issues claims
+    [% ELSIF used_for_code == 'late_orders' %] Export late orders
     [% ELSIF used_for_code == 'export_basket' %] Basket export in acquisition
+    [% ELSIF used_for_code == 'export_lost_items' %] Export lost items in report
     [% ELSE %] Unknown usage
     [% END %]
 [% END %]
@@ -125,15 +108,15 @@ function reloadPage(p) {
 
     <form action="/cgi-bin/koha/tools/csv-profiles.pl" class="validated" method="post">
         <input type="hidden" name="op" value="add_validate" />
-        <input type="hidden" name="export_format_id" value="[% csv_profile.export_format_id %]" />
+        <input type="hidden" name="export_format_id" value="[% csv_profile.export_format_id | html %]" />
         <fieldset class="rows">
             <ol>
                 [% IF csv_profile %]
-                    <li><span class="label">Profile ID: </span>[% csv_profile.export_format_id %]</li>
+                    <li><span class="label">Profile ID: </span>[% csv_profile.export_format_id | html %]</li>
                 [% END %]
                 <li>
                     <label for="profile" class="required">Profile name: </label>
-                    <input type="text" name="profile" id="profile" value="[% csv_profile.profile %]" class="required">
+                    <input type="text" name="profile" id="profile" value="[% csv_profile.profile | html %]" class="required">
                     <span class="required">Required</span>
                 </li>
                 <li>
@@ -141,9 +124,9 @@ function reloadPage(p) {
                     <select id="type" name="type">
                         [% FOREACH type IN [ 'marc' 'sql'] %]
                         [% IF csv_profile.type == type %]
-                            <option value="[% type %]" selected="selected">[% PROCESS type_description type_code = type %]</option>
+                            <option value="[% type | html %]" selected="selected">[% PROCESS type_description type_code = type %]</option>
                         [% ELSE %]
-                            <option value="[% type %]">[% PROCESS type_description type_code = type %]</option>
+                            <option value="[% type | html %]">[% PROCESS type_description type_code = type %]</option>
                         [% END %]
                         [% END %]
                     </select>
@@ -152,11 +135,11 @@ function reloadPage(p) {
                 <li class="sql_specific">
                     <label for="used_for_sql">Usage: </label>
                     <select id="used_for_sql" name="used_for_sql">
-                        [% FOREACH used_for IN [ 'late_issues' 'export_basket' ] %]
+                        [% FOREACH used_for IN [ 'late_issues' 'late_orders', 'export_basket' 'export_lost_items' ] %]
                         [% IF csv_profile.used_for == used_for %]
-                            <option value="[% used_for %]" selected="selected">[% PROCESS used_for_description used_for_code = used_for %]</option>
+                            <option value="[% used_for | html %]" selected="selected">[% PROCESS used_for_description used_for_code = used_for %]</option>
                         [% ELSE %]
-                            <option value="[% used_for %]">[% PROCESS used_for_description used_for_code = used_for %]</option>
+                            <option value="[% used_for | html %]">[% PROCESS used_for_description used_for_code = used_for %]</option>
                         [% END %]
                         [% END %]
                     </select>
@@ -166,16 +149,16 @@ function reloadPage(p) {
                     <select id="used_for_marc" name="used_for_marc">
                         [% FOREACH used_for IN [ 'export_records' ] %]
                         [% IF csv_profile.used_for == used_for %]
-                            <option value="[% used_for %]" selected="selected">[% PROCESS used_for_description used_for_code = used_for %]</option>
+                            <option value="[% used_for | html %]" selected="selected">[% PROCESS used_for_description used_for_code = used_for %]</option>
                         [% ELSE %]
-                            <option value="[% used_for %]">[% PROCESS used_for_description used_for_code = used_for %]</option>
+                            <option value="[% used_for | html %]">[% PROCESS used_for_description used_for_code = used_for %]</option>
                         [% END %]
                         [% END %]
                     </select>
                 </li>
                 <li>
                     <label for="description">Profile description: </label>
-                    <textarea cols="50" rows="2" name="description" id="description">[% csv_profile.description %]</textarea>
+                    <textarea cols="50" rows="2" name="description" id="description">[% csv_profile.description | html %]</textarea>
                 </li>
                 <li>
                     <label for="csv_separator">CSV separator: </label>
@@ -201,9 +184,9 @@ function reloadPage(p) {
                     <select name="encoding" id="encoding">
                         [% FOREACH encoding IN encodings %]
                             [% IF csv_profile.encoding == encoding OR NOT csv_profile AND encoding == 'utf8' %]
-                                <option selected="selected">[% encoding %]</option>
+                                <option selected="selected">[% encoding | html %]</option>
                             [% ELSE %]
-                                <option>[% encoding %]</option>
+                                <option>[% encoding | html %]</option>
                             [% END %]
                         [% END %]
                     </select>
@@ -211,7 +194,7 @@ function reloadPage(p) {
 
                 <li class="marc_specific">
                     <label for="marc_content" class="required">Profile MARC fields: </label>
-                    <textarea cols="50" rows="2" name="marc_content" id="marc_content">[% csv_profile.content %]</textarea>
+                    <textarea cols="50" rows="2" name="marc_content" id="marc_content">[% csv_profile.content | html %]</textarea>
                     <span class="required">Required</span>
                     <p>You have to define which fields or subfields you want to export, separated by pipes.</p>
                     <p>You can also use your own headers (instead of the ones from Koha) by prefixing the field number with an header, followed by the equal sign.</p>
@@ -220,13 +203,14 @@ function reloadPage(p) {
                 </li>
 
                 <li class="sql_specific">
-                    <label for="late_issues_content" class="required">Profile SQL fields: </label>
-                    <textarea cols="50" rows="2" name="sql_content" id="sql_content">[% csv_profile.content %]</textarea>
+                    <label for="sql_content" class="required">Profile SQL fields: </label>
+                    <textarea cols="50" rows="2" name="sql_content" id="sql_content">[% csv_profile.content | html %]</textarea>
                     <p>You have to define which fields you want to export, separated by pipes.</p>
                     <p>You can also use your own headers (instead of the ones from Koha) by prefixing the field name with an header, followed by the equal sign.</p>
                     <p>Example: Name=subscription.name|Title=subscription.title|Issue number=serial.serialseq</p>
                     <p>For late issues claims you can use data from following tables: serial, subscription, biblio, biblioitems and aqbookseller.</p>
                     <p>For basket exports you can use data from following tables: biblio, biblioitems, aqorders, aqbudgets and aqbasket.</p>
+                    <p>For exporting late orders you must provide a profile in Template Toolkit syntax to generate the CSV file.</p>
                 </li>
             </ol>
         </fieldset>
@@ -240,10 +224,10 @@ function reloadPage(p) {
 [% IF op == 'delete_confirm' %]
     <div class="dialog alert">
         [% IF csv_profile %]
-            <h3>Delete CSV Profile "[% csv_profile.profile %]?"</h3>
+            <h3>Delete CSV Profile "[% csv_profile.profile | html %]?"</h3>
             <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="post">
                 <input type="hidden" name="op" value="delete_confirmed" />
-                <input type="hidden" name="export_format_id" value="[% csv_profile.export_format_id %]" />
+                <input type="hidden" name="export_format_id" value="[% csv_profile.export_format_id | html %]" />
                 <input type="submit" class="approve" value="Yes, delete" />
             </form>
             <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="get">
@@ -258,7 +242,7 @@ function reloadPage(p) {
 [% IF op == 'list' %]
 
     <div id="toolbar" class="btn-toolbar">
-        <a class="btn btn-default btn-sm" id="newcsvprofile" href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form"><i class="fa fa-plus"></i> New CSV profile</a>
+        <a class="btn btn-default" id="newcsvprofile" href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form"><i class="fa fa-plus"></i> New CSV profile</a>
     </div>
 
     <h2>CSV profiles</h2>
@@ -278,16 +262,16 @@ function reloadPage(p) {
             <tbody>
                 [% FOREACH csv_profile IN csv_profiles %]
                 <tr>
-                    <td>[% csv_profile.export_format_id %]</td>
-                    <td>[% csv_profile.profile |html %]</td>
-                    <td>[% csv_profile.description |html %]</td>
-                    <td>[% csv_profile.content |html %]</td>
-                    <td>[% csv_profile.csv_separator %]</td>
+                    <td>[% csv_profile.export_format_id | html %]</td>
+                    <td>[% csv_profile.profile | html %]</td>
+                    <td>[% csv_profile.description | html %]</td>
+                    <td>[% csv_profile.content | html | html_line_break %]</td>
+                    <td>[% csv_profile.csv_separator | html %]</td>
                     <td>[% PROCESS type_description type_code = csv_profile.type %]</td>
                     <td>[% PROCESS used_for_description used_for_code = csv_profile.used_for %]</td>
                     <td class="actions">
-                        <a href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&amp;export_format_id=[% csv_profile.export_format_id %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
-                        <a href="/cgi-bin/koha/tools/csv-profiles.pl?op=delete_confirm&amp;export_format_id=[% csv_profile.export_format_id %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
+                        <a href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&amp;export_format_id=[% csv_profile.export_format_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
+                        <a href="/cgi-bin/koha/tools/csv-profiles.pl?op=delete_confirm&amp;export_format_id=[% csv_profile.export_format_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
                     </td>
                 </tr>
                 [% END %]
@@ -298,10 +282,40 @@ function reloadPage(p) {
     [% END %]
 [% END %]
 
-</div>
-</div>
-<div class="yui-b noprint">
-[% INCLUDE 'tools-menu.inc' %]
-</div>
-</div>
+            </main>
+        </div> <!-- /.col-sm-10.col-sm-push-2 -->
+
+        <div class="col-sm-2 col-sm-pull-10">
+            <aside>
+                [% INCLUDE 'tools-menu.inc' %]
+            </aside>
+        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
+     </div> <!-- /.row -->
+
+[% MACRO jsinclude BLOCK %]
+    [% Asset.js("js/tools-menu.js") | $raw %]
+    <script>
+        function reloadPage(p) {
+            var id = p.value;
+            if (id != 0) { document.location = "/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&amp;export_format_id=" + id; }
+        }
+        $(document).ready(function() {
+            $("#type").change(function(){
+                if ( $(this).find("option:selected").val() == "marc" ) {
+                    $("li.marc_specific").show();
+                    $("#marc_content").attr("required", "required");
+                    $("li.sql_specific").hide();
+                    $("#sql_content").removeAttr("required");
+                } else {
+                    $("li.marc_specific").hide();
+                    $("#marc_content").removeAttr("required");
+                    $("li.sql_specific").show();
+                    $("#sql_content").attr("required", "required");
+                }
+            });
+            $("#type").change();
+        });
+    </script>
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]