Bug 17698: (follow-up) Fixing some small issues
authorAleisha Amohia <aleishaamohia@hotmail.com>
Thu, 12 Apr 2018 04:04:48 +0000 (04:04 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 23 Jul 2018 15:23:42 +0000 (15:23 +0000)
Fixing the comments in Comment 42

Ready to test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

circ/on-site_checkouts.pl
installer/data/mysql/atomicupdate/bug-17698_add-permission-to-manage-checkout-notes.sql
installer/data/mysql/userpermissions.sql
koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt

index bcf78cc..05eef2c 100755 (executable)
@@ -45,7 +45,7 @@ my $pending_onsite_checkouts = C4::Circulation::GetPendingOnSiteCheckouts();
 
 $template->param(
     pending_onsite_checkouts => $pending_onsite_checkouts,
-    pending_onsite_notes     => $pending_onsite_notes,
+    pending_checkout_notes   => $pending_checkout_notes,
 );
 
 output_html_with_http_headers $cgi, $cookie, $template->output;
index 343314b..86d4351 100644 (file)
@@ -1 +1 @@
-INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'manage_checkout_nots', 'Mark checkout notes as seen/not seen');
+INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen');
index ec53b0d..e0c4ed3 100644 (file)
@@ -4,7 +4,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
    ( 1, 'overdues_report', 'Execute overdue items report'),
    ( 1, 'force_checkout', 'Force checkout if a limitation exists'),
    ( 1, 'manage_restrictions', 'Manage restrictions for accounts'),
-   ( 1, 'manage_checkout_nots', 'Mark checkout notes as seen/not seen'),
+   ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen'),
    ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
    ( 3, 'manage_circ_rules', 'Manage circulation rules'),
    ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
index 62c087d..3ec45f9 100644 (file)
@@ -1,79 +1,11 @@
 [% USE Koha %]
 [% USE KohaDates %]
 [% USE Branches %]
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Home &rsaquo; Circulation &rsaquo; Checkout Notes</title>
+<title>Home &rsaquo; Circulation &rsaquo; Checkout notes</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
-[% INCLUDE 'datatables.inc' %]
-<script type="text/javascript">
-//<![CDATA[
-    $(document).ready(function(){
-        $("#notestable").dataTable($.extend(true, {}, dataTablesDefaults, {
-            "aoColumnDefs": [
-                { "aTargets": [ 0, -1 ], "bSearchable": false, "bSortable": false },
-            ],
-            "sPaginationType": "four_button"
-        }));
-
-        $(".SelectAll").on("click", function(){
-            $("input[name='issue_ids'][type='checkbox']").prop("checked", true);
-            $(".btn-sm").prop("disabled", false);
-        });
-
-        $(".ClearAll").on("click", function(){
-            $("input[name='issue_ids'][type='checkbox']").prop("checked", false);
-            $(".btn-sm").prop("disabled", true);
-        });
-
-        $("#error").hide();
-
-        $("input[type='checkbox']").click(function(event){
-            if ( $("input[type='checkbox']").is(":checked") ) {
-                $(".btn-sm").prop("disabled", false);
-            } else {
-                $(".btn-sm").prop("disabled", true);
-            }
-        });
-
-        $(".btn-xs").click(function(event){
-            event.preventDefault(); // prevent form submission
-            var $action = $(this).attr("name");
-            var $issue_id = $(this).data('issue_id');
-            var ajaxData = {
-                'action': $action,
-                'issue_id': $issue_id,
-            };
-
-            $.ajax({
-                url: '/cgi-bin/koha/svc/checkout_notes/',
-                type: 'POST',
-                dataType: 'json',
-                data: ajaxData,
-            })
-
-            .done(function(data){
-                if (data.status == 'success'){
-                    if ( $action == 'notseen' ){
-                        $("#status_" + $issue_id).text("Not seen");
-                        $(event.target).siblings(".seen").prop("disabled", false);
-                        $(event.target).prop("disabled", true);
-                    } else {
-                        $("#status_" + $issue_id).text("Seen");
-                        $(event.target).siblings(".notseen").prop("disabled", false);
-                        $(event.target).prop("disabled", true);
-                    }
-                } else {
-                    $("#error").text(_("Unable to change status of note."));
-                    $("#error").show();
-                }
-            });
-        });
-    });
-//]]>
-</script>
-[% INCLUDE 'calendar.inc' %]
-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 </head>
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'circ-search.inc' %]
                                         <td>[% note.item.biblio.title %] - [% note.item.biblio.author %] (<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% note.item.biblionumber %]">[% note.item.barcode %]</a>)</td>
                                         <td>[% note.note %]</td>
                                         <td>[% note.notedate | $KohaDates %]</td>
-                                        <td>[% IF note.patron.title %][% note.patron.title [% END %][% note.patron.firstname %] [% note.patron.surname %] (<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% note.patron.borrowernumber %]">[% note.patron.cardnumber %]</a>)</td>
+                                        <td>[% IF note.patron.title %][% note.patron.title %][% END %][% note.patron.firstname %] [% note.patron.surname %] (<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% note.patron.borrowernumber %]">[% note.patron.cardnumber %]</a>)</td>
                                         <td>
                                             [% IF ( note.noteseen == 0 ) %]
                                                 <span id="status_[% note.issue_id %]">Not seen</span>
     </div> <!-- bd -->
 </div> <!-- doc3 -->
 
+[% MACRO jsinclude BLOCK %]
+    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min_[% KOHA_VERSION %].js"></script>
+    [% INCLUDE 'calendar.inc' %]
+    [% INCLUDE 'datatables.inc' %]
+    <script type="text/javascript">
+    //<![CDATA[
+        $(document).ready(function(){
+            $("#notestable").dataTable($.extend(true, {}, dataTablesDefaults, {
+                "aoColumnDefs": [
+                    { "aTargets": [ 0, -1 ], "bSearchable": false, "bSortable": false },
+                ],
+                "sPaginationType": "four_button"
+            }));
+
+            $(".SelectAll").on("click", function(){
+                $("input[name='issue_ids'][type='checkbox']").prop("checked", true);
+                $(".btn-sm").prop("disabled", false);
+            });
+
+            $(".ClearAll").on("click", function(){
+                $("input[name='issue_ids'][type='checkbox']").prop("checked", false);
+                $(".btn-sm").prop("disabled", true);
+            });
+
+            $("#error").hide();
+
+            $("input[type='checkbox']").click(function(event){
+                if ( $("input[type='checkbox']").is(":checked") ) {
+                    $(".btn-sm").prop("disabled", false);
+                } else {
+                    $(".btn-sm").prop("disabled", true);
+                }
+            });
+
+            $(".btn-xs").click(function(event){
+                event.preventDefault(); // prevent form submission
+                var $action = $(this).attr("name");
+                var $issue_id = $(this).data('issue_id');
+                var ajaxData = {
+                    'action': $action,
+                    'issue_id': $issue_id,
+                };
+
+                $.ajax({
+                    url: '/cgi-bin/koha/svc/checkout_notes/',
+                    type: 'POST',
+                    dataType: 'json',
+                    data: ajaxData,
+                })
+
+                .done(function(data){
+                    if (data.status == 'success'){
+                        if ( $action == 'notseen' ){
+                            $("#status_" + $issue_id).text(_("Not seen"));
+                            $(event.target).siblings(".seen").prop("disabled", false);
+                            $(event.target).prop("disabled", true);
+                        } else {
+                            $("#status_" + $issue_id).text(_("Seen"));
+                            $(event.target).siblings(".notseen").prop("disabled", false);
+                            $(event.target).prop("disabled", true);
+                        }
+                    } else {
+                        $("#error").text(_("Unable to change status of note."));
+                        $("#error").show();
+                    }
+                });
+            });
+        });
+    //]]>
+    </script>
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]
index 59cc746..55048c0 100644 (file)
                 <div class="row">
                     <div class="col-sm-12">
                         [%# Following statement must be in one line for translatability %]
-                        [% IF ( ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_acquisition && pendingsuggestions ) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests) %]
+                        [% IF ( ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_acquisition && pendingsuggestions ) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests) || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes ) %]
                             <div id="area-pending">
                                 [% IF pending_article_requests %]
                                 <div class="pending-info" id="article_requests_pending">