Bug 17698: (follow-up) Fixing some small issues

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>
This commit is contained in:
Aleisha Amohia 2018-04-12 04:04:48 +00:00 committed by Nick Clemens
parent cd4d46882f
commit ac4014d21b
5 changed files with 79 additions and 75 deletions

View File

@ -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;

View 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');

View 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'),

View 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' %]
@ -131,7 +63,7 @@
<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>
@ -175,4 +107,76 @@
</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' %]

View File

@ -125,7 +125,7 @@
<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">