Bugzilla – Attachment 25218 Details for
Bug 11703
Convert checkouts table to ajax datatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11703 - Use the ajax datatables on patron details page
Bug-11703---Use-the-ajax-datatables-on-patron-deta.patch (text/plain), 43.12 KB, created by
Kyle M Hall (khall)
on 2014-02-13 13:35:35 UTC
(
hide
)
Description:
Bug 11703 - Use the ajax datatables on patron details page
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-02-13 13:35:35 UTC
Size:
43.12 KB
patch
obsolete
>From e8df3a1b13fb47cee7c686d515a31d08d8d8ad2a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 13 Feb 2014 08:28:49 -0500 >Subject: [PATCH] Bug 11703 - Use the ajax datatables on patron details page > >--- > koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 123 ++++++++ > .../intranet-tmpl/prog/en/js/pages/circulation.js | 129 -------- > .../prog/en/modules/circ/circulation.tt | 84 ++---- > .../prog/en/modules/members/moremember.tt | 319 ++++++-------------- > members/moremember.pl | 129 +------- > 5 files changed, 261 insertions(+), 523 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >index 234282d..4cc8e32 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >@@ -1,4 +1,127 @@ > $(document).ready(function() { >+ // Handle the select all/none links for checkouts table columns >+ $("#CheckAllRenewals").on("click",function(){ >+ $("#UncheckAllCheckins").click(); >+ $(".renew:visible").attr("checked", "checked" ); >+ return false; >+ }); >+ $("#UncheckAllRenewals").on("click",function(){ >+ $(".renew:visible").removeAttr("checked"); >+ return false; >+ }); >+ >+ $("#CheckAllCheckins").on("click",function(){ >+ $("#UncheckAllRenewals").click(); >+ $(".checkin:visible").attr("checked", "checked" ); >+ return false; >+ }); >+ $("#UncheckAllCheckins").on("click",function(){ >+ $(".checkin:visible").removeAttr("checked"); >+ return false; >+ }); >+ >+ // Don't allow both return and renew checkboxes to be checked >+ $(document).on("change", '.renew', function(){ >+ if ( $(this).is(":checked") ) { >+ $( "#checkin_" + $(this).val() ).removeAttr("checked"); >+ } >+ }); >+ $(document).on("change", '.checkin', function(){ >+ if ( $(this).is(":checked") ) { >+ $( "#renew_" + $(this).val() ).removeAttr("checked"); >+ } >+ }); >+ >+ // Clicking the table cell checks the checkbox inside it >+ $(document).on("click", 'td', function(e){ >+ if(e.target.tagName.toLowerCase() == 'td'){ >+ $(this).find("input:checkbox:visible").each( function() { >+ $(this).click(); >+ }); >+ } >+ }); >+ >+ // Handle renewals >+ $("#RenewCheckinChecked").on("click",function(){ >+ $(".checkin:checked:visible").each(function() { >+ itemnumber = $(this).val(); >+ >+ $(this).replaceWith("<img id='checkin_" + itemnumber + "' src='" + interface + "/" + theme + "/img/loading-small.gif' />"); >+ >+ params = { >+ itemnumber: itemnumber, >+ borrowernumber: borrowernumber, >+ branchcode: branchcode, >+ exempt_fine: $("#exemptfine").is(':checked') >+ }; >+ >+ $.post( "/cgi-bin/koha/api/checkin.pl", params, function( data ) { >+ id = "#checkin_" + data.itemnumber; >+ >+ content = ""; >+ if ( data.returned ) { >+ content = _("Returned"); >+ } else { >+ content = _("Unable to return"); >+ } >+ >+ $(id).replaceWith( content ); >+ }, "json") >+ }); >+ >+ $(".renew:checked:visible").each(function() { >+ var override_limit = $("#override_limit").is(':checked') ? 1 : 0; >+ >+ var itemnumber = $(this).val(); >+ >+ $(this).replaceWith("<img id='renew_" + itemnumber + "' src='" + interface + "/" + theme + "/img/loading-small.gif' />"); >+ >+ var params = { >+ itemnumber: itemnumber, >+ borrowernumber: borrowernumber, >+ branchcode: branchcode, >+ override_limit: override_limit, >+ date_due: $("#newduedate").val() >+ }; >+ >+ $.post( "/cgi-bin/koha/api/renew.pl", params, function( data ) { >+ var id = "#renew_" + data.itemnumber; >+ >+ var content = ""; >+ if ( data.renew_okay ) { >+ content = _("Renewed, due: ") + data.date_due; >+ } else { >+ content = _("Renew failed: "); >+ if ( data.error == "no_checkout" ) { >+ content += _("not checked out"); >+ } else if ( data.error == "too_many" ) { >+ content += _("too many renewals"); >+ } else if ( data.error == "on_reserve" ) { >+ content += _("on reserve"); >+ } else if ( data.error ) { >+ content += data.error; >+ } else { >+ content += _("reason unknown"); >+ } >+ } >+ >+ $(id).replaceWith( content ); >+ }, "json") >+ }); >+ >+ // Prevent form submit >+ return false; >+ }); >+ >+ $("#RenewAll").on("click",function(){ >+ $("#CheckAllRenewals").click(); >+ $("#UncheckAllCheckins").click(); >+ $("#RenewCheckinChecked").click(); >+ >+ // Prevent form submit >+ return false; >+ }); >+ > var ymd = $.datepicker.formatDate('yy-mm-dd', new Date()); > > $("#issues-table").dataTable({ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js >index 49dc9ae..489403f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js >@@ -1,25 +1,4 @@ > $(document).ready(function() { >- // Handle the select all/none links for checkouts table columns >- $("#CheckAllRenewals").on("click",function(){ >- $("#UncheckAllCheckins").click(); >- $(".renew:visible").attr("checked", "checked" ); >- return false; >- }); >- $("#UncheckAllRenewals").on("click",function(){ >- $(".renew:visible").removeAttr("checked"); >- return false; >- }); >- >- $("#CheckAllCheckins").on("click",function(){ >- $("#UncheckAllRenewals").click(); >- $(".checkin:visible").attr("checked", "checked" ); >- return false; >- }); >- $("#UncheckAllCheckins").on("click",function(){ >- $(".checkin:visible").removeAttr("checked"); >- return false; >- }); >- > $("#CheckAllExports").on("click",function(){ > $(".export:visible").attr("checked", "checked" ); > return false; >@@ -29,99 +8,6 @@ $(document).ready(function() { > return false; > }); > >- // Don't allow both return and renew checkboxes to be checked >- $(document).on("change", '.renew', function(){ >- if ( $(this).is(":checked") ) { >- $( "#checkin_" + $(this).val() ).removeAttr("checked"); >- } >- }); >- $(document).on("change", '.checkin', function(){ >- if ( $(this).is(":checked") ) { >- $( "#renew_" + $(this).val() ).removeAttr("checked"); >- } >- }); >- >- // Handle renewals >- $("#RenewCheckinChecked").on("click",function(){ >- $(".checkin:checked:visible").each(function() { >- itemnumber = $(this).val(); >- >- $(this).replaceWith("<img id='checkin_" + itemnumber + "' src='" + interface + "/" + theme + "/img/loading-small.gif' />"); >- >- params = { >- itemnumber: itemnumber, >- borrowernumber: borrowernumber, >- branchcode: branchcode, >- exempt_fine: $("#exemptfine").is(':checked') >- }; >- >- $.post( "/cgi-bin/koha/api/checkin.pl", params, function( data ) { >- id = "#checkin_" + data.itemnumber; >- >- content = ""; >- if ( data.returned ) { >- content = _("Returned"); >- } else { >- content = _("Unable to return"); >- } >- >- $(id).replaceWith( content ); >- }, "json") >- }); >- >- $(".renew:checked:visible").each(function() { >- var override_limit = $("#override_limit").is(':checked') ? 1 : 0; >- >- var itemnumber = $(this).val(); >- >- $(this).replaceWith("<img id='renew_" + itemnumber + "' src='" + interface + "/" + theme + "/img/loading-small.gif' />"); >- >- var params = { >- itemnumber: itemnumber, >- borrowernumber: borrowernumber, >- branchcode: branchcode, >- override_limit: override_limit, >- date_due: $("#newduedate").val() >- }; >- >- $.post( "/cgi-bin/koha/api/renew.pl", params, function( data ) { >- var id = "#renew_" + data.itemnumber; >- >- var content = ""; >- if ( data.renew_okay ) { >- content = _("Renewed, due: ") + data.date_due; >- } else { >- content = _("Renew failed: "); >- if ( data.error == "no_checkout" ) { >- content += _("not checked out"); >- } else if ( data.error == "too_many" ) { >- content += _("too many renewals"); >- } else if ( data.error == "on_reserve" ) { >- content += _("on reserve"); >- } else if ( data.error ) { >- content += data.error; >- } else { >- content += _("reason unknown"); >- } >- } >- >- $(id).replaceWith( content ); >- }, "json") >- }); >- >- // Prevent form submit >- return false; >- }); >- >- $("#RenewAll").on("click",function(){ >- $("#CheckAllRenewals").click(); >- $("#UncheckAllCheckins").click(); >- $("#RenewCheckinChecked").click(); >- >- // Prevent form submit >- return false; >- }); >- > $('#patronlists').tabs(); > > $("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+MSG_ADD_MESSAGE+"</a>"); >@@ -156,14 +42,6 @@ $(document).ready(function() { > return false; > }); > >- // Clicking the table cell checks the checkbox inside it >- $(document).on("click", 'td', function(e){ >- if(e.target.tagName.toLowerCase() == 'td'){ >- $(this).find("input:checkbox:visible").each( function() { >- $(this).click(); >- }); >- } >- }); > }); > > function export_checkouts(format) { >@@ -200,10 +78,3 @@ function validate1(date) { > return false; > } > } >- >-// prevent adjacent checkboxes from being checked simultaneously >-function radioCheckBox(box){ >- box.parents("td").siblings().find("input:checkbox.radio").each(function(){ >- $(this).removeAttr("checked"); >- }); >- } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index d148cfb..aa9feab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -668,8 +668,7 @@ No patron matched <span class="ex">[% message %]</span> > > <!-- SUMMARY : TODAY & PREVIOUS ISSUES --> > <div id="checkouts"> >-[% IF ( issuecount ) %] >- <form name="issues" action="/cgi-bin/koha/tools/export.pl" method="post" class="checkboxed"> >+ [% IF ( issuecount ) %] > <table id="issues-table"> > <thead> > <tr> >@@ -689,64 +688,39 @@ No patron matched <span class="ex">[% message %]</span> > [% INCLUDE 'checkouts-table-footer.inc' %] > </table> > >- [% IF ( issuecount ) %] >- <fieldset class="action"> >- [% IF ( CAN_user_circulate_override_renewals ) %] >- [% IF ( AllowRenewalLimitOverride ) %] >- <label for="override_limit">Override renewal limit:</label> >- <input type="checkbox" name="override_limit" id="override_limit" value="1" /> >- [% END %] >+ <fieldset class="action"> >+ [% IF ( CAN_user_circulate_override_renewals ) %] >+ [% IF ( AllowRenewalLimitOverride ) %] >+ <label for="override_limit">Override renewal limit:</label> >+ <input type="checkbox" name="override_limit" id="override_limit" value="1" /> > [% END %] >- <button class="btn" id="RenewCheckinChecked"><i class="icon-check"></i> Renew or return checked items</button> >- <button class="btn" id="RenewAll"><i class="icon-book"></i> Renew all</button> >- </fieldset> >- >- [% IF ( exports_enabled ) %] >- <fieldset> >- <label for="export_formats"><b>Export checkouts using format:</b></label> >- <select name="export_formats" id="export_formats"> >- <option value="iso2709_995">ISO2709 with items</option> >- <option value="iso2709">ISO2709 without items</option> >- [% IF ( export_with_csv_profile ) %] >- <option value="csv">CSV</option> >- [% END %] >- </select> >- >- <label for="export_remove_fields">Don't export fields:</label> <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" /> >- <input type="hidden" name="op" value="export" /> >- <input type="hidden" id="export_format" name="format" value="iso2709" /> >- <input type="hidden" id="dont_export_item" name="dont_export_item" value="0" /> >- <input type="hidden" id="record_type" name="record_type" value="bibs" /> >- <button class="btn btn-small" id="export_submit"><i class="icon-download-alt"></i> Export</button> >- </fieldset> > [% END %] >- [% END %] >- </form> >-[% ELSE %] >- <p>Patron has nothing checked out.</p> >-[% END %] >- >+ <button class="btn" id="RenewCheckinChecked"><i class="icon-check"></i> Renew or return checked items</button> >+ <button class="btn" id="RenewAll"><i class="icon-book"></i> Renew all</button> >+ </fieldset> >+ [% ELSE %] >+ <p>Patron has nothing checked out.</p> >+ [% END %] > </div> > >- > [% IF ( relatives_issues_count ) %] >-<div id="relatives-issues"> >- <table id="relatives-issues-table"> >- <thead> >- <tr> >- <th scope="col">Due date</th> >- <th scope="col">Title</th> >- <th scope="col">Item type</th> >- <th scope="col">Checked out on</th> >- <th scope="col">Checked out from</th> >- <th scope="col">Call no</th> >- <th scope="col">Charge</th> >- <th scope="col">Price</th> >- <th scope="col">Patron</th> >- </tr> >- </thead> >- </table> >-</div> >+ <div id="relatives-issues"> >+ <table id="relatives-issues-table"> >+ <thead> >+ <tr> >+ <th scope="col">Due date</th> >+ <th scope="col">Title</th> >+ <th scope="col">Item type</th> >+ <th scope="col">Checked out on</th> >+ <th scope="col">Checked out from</th> >+ <th scope="col">Call no</th> >+ <th scope="col">Charge</th> >+ <th scope="col">Price</th> >+ <th scope="col">Patron</th> >+ </tr> >+ </thead> >+ </table> >+ </div> > [% END %] > > [% INCLUDE borrower_debarments.inc %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 79d319e..2d81c13 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -15,8 +15,21 @@ > <script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script> > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script> >+<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script> > <script type="text/JavaScript"> > //<![CDATA[ >+/* Set some variable needed in circulation.js */ >+var interface = "[% interface %]"; >+var theme = "[% theme %]"; >+var borrowernumber = "[% borrowernumber %]"; >+var branchcode = "[% branch %]"; >+var exports_enabled = "[% exports_enabled %]"; >+var AllowRenewalLimitOverride = [% CAN_user_circulate_override_renewals && AllowRenewalLimitOverride %]; >+var relatives_borrowernumbers = new Array(); >+[% FOREACH b IN relatives_borrowernumbers %] >+ relatives_borrowernumbers.push("[% b %]"); >+[% END %] >+ > $(document).ready(function() { > $('#finesholdsissues').tabs({ > // Correct table sizing for tables hidden in tabs >@@ -28,23 +41,6 @@ $(document).ready(function() { > } > } > } ); >- $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sDom": 't', >- "aoColumnDefs": [ >- { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false } >- ], >- "aoColumns": [ >- { "sType": "title-string" },null,null,{ "sType": "title-string" },null,null,null,null,null,null >- ], >- "bPaginate": false >- })); >- $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sDom": 't', >- "aoColumns": [ >- { "sType": "title-string" },null,null,{ "sType": "title-string" },null,null,null,null,null >- ], >- "bPaginate": false >- })); > $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, { > "sDom": 't', > "aoColumnDefs": [ >@@ -67,42 +63,7 @@ $(document).ready(function() { > } > return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone.")); > });[% END %] >- $("#renew_all" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[name*=items]" ); $(".checkboxed").unCheckCheckboxes(":input[name*=barcodes]"); }); >- $("#CheckAllitems" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[name*=items]" ); $(".checkboxed").unCheckCheckboxes(":input[name*=barcodes]"); return false; }); >- $("#CheckNoitems" ).click(function(){ $(".checkboxed").unCheckCheckboxes(":input[name*=items]"); return false; }); >- $("#CheckAllreturns").click(function(){ $(".checkboxed").checkCheckboxes(":input[name*=barcodes]"); $(".checkboxed").unCheckCheckboxes(":input[name*=items]"); return false; }); >- $("#CheckNoreturns" ).click(function(){ $(".checkboxed").unCheckCheckboxes(":input[name*=barcodes]"); return false; }); >- >- $("#relrenew_all" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[name*=items]" ); $(".checkboxed").unCheckCheckboxes(":input[name*=barcodes]"); }); >- $("#relCheckAllitems" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[name*=items]" ); $(".checkboxed").unCheckCheckboxes(":input[name*=barcodes]"); return false; }); >- $("#relCheckNoitems" ).click(function(){ $(".checkboxed").unCheckCheckboxes(":input[name*=items]"); return false; }); >- $("#relCheckAllreturns").click(function(){ $(".checkboxed").checkCheckboxes(":input[name*=barcodes]"); $(".checkboxed").unCheckCheckboxes(":input[name*=items]"); return false; }); >- $("#relCheckNoreturns" ).click(function(){ $(".checkboxed").unCheckCheckboxes(":input[name*=barcodes]"); return false; }); >- >- >- [% IF ( CAN_user_circulate_override_renewals ) %] >- [% IF ( AllowRenewalLimitOverride ) %] >- $( '#override_limit' ).click( function () { >- if ( this.checked ) { >- $( '.renewals-allowed' ).show(); $( '.renewals-disabled' ).hide(); >- } else { >- $( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show(); >- } >- } ).attr( 'checked', false ); >- [% END %] >- [% END %] >- $("td").click(function(e){ >- if(e.target.tagName.toLowerCase() == 'td'){ >- $(this).find("input:checkbox").each( function() { >- $(this).attr('checked', !$(this).attr('checked')); >- if($(this).attr('checked')){ >- $(this).parent().siblings().find("input:checkbox").each(function(){ >- if($(this).attr('checked')){ $(this).removeAttr('checked'); } >- }); >- } >- }); >- } >- }); >+ > $("#suspend_until").datepicker({ minDate: 1 }); // require that hold suspended until date is after today > $("#newduedate").datetimepicker({ > minDate: 1, // require that renewal date is after today >@@ -427,188 +388,100 @@ function validate1(date) { > > <div id="finesholdsissues" class="toptabs"> > <ul> >- <li><a href="#checkedout">[% issueloop.size %] Checkout(s)</a></li> >- [% IF relissueloop.size %] >- <li><a href="#relissues">Relatives' Checkouts</a></li> >- [% END %] >+ <li><a href="#checkouts">[% issueloop.size %] Checkout(s)</a></li> >+ [% IF relatives_issues_count %] >+ <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li> >+ [% END %] > <li><a href="#finesandcharges">Fines & Charges</a></li> >- <li>[% IF ( countreserv ) %] >- <a href="#onhold">[% countreserv %] Hold(s)</a> [% ELSE %] >- <a href="#onhold">0 Holds</a> >- [% END %]</li> >+ <li> >+ [% IF ( countreserv ) %] >+ <a href="#onhold">[% countreserv %] Hold(s)</a> >+ [% ELSE %] >+ <a href="#onhold">0 Holds</a> >+ [% END %] >+ </li> > <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li> > </ul> > >- <form action="/cgi-bin/koha/reserve/renewscript.pl" method="post" class="checkboxed"> >- <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >- <input type="hidden" name="branch" value="[% branch %]" /> >-<div id="checkedout"> >- [% IF ( issueloop ) %] >- <table id="issuest"> >- <thead> >- <tr> >- <th scope="col">Due date</th> >- <th scope="col">Title</th> >- <th scope="col">Item type</th> >- <th scope="col">Checked out on</th> >- <th scope="col">Checked out from</th> >- <th scope="col">Call no.</th> >- <th scope="col">Charge</th> >- <th scope="col">Price</th> >- <th scope="col">Renew <p class="column-tool"><a href="#" id="CheckAllitems">select all</a> | <a href="#" id="CheckNoitems">none</a></p></th> >- <th scope="col">Check in <p class="column-tool"><a href="#" id="CheckAllreturns">select all</a> | <a href="#" id="CheckNoreturns">none</a></p></th> >- </tr></thead> >- [% INCLUDE 'checkouts-table-footer.inc' %] >- <tbody> >- [% FOREACH issueloo IN issueloop %] >- >- [% IF ( issueloo.overdue ) %] >- <tr class="problem"> >- [% ELSE %] >- <tr> >- [% END %] >- [% IF ( issueloo.red ) %] >- <td class="od"> >- [% ELSE %] >- <td> >- [% END %] >- <span title="[% issueloo.date_due %]">[% issueloo.date_due | $KohaDates %]</span> >- [% IF ( issueloo.itemlost ) %] >- <span class="lost">[% issueloo.itemlost %]</span> >+ <div id="checkouts"> >+ [% IF ( issuecount ) %] >+ <form name="issues" action="/cgi-bin/koha/tools/export.pl" method="post" class="checkboxed"> >+ <table id="issues-table" style="width: 100% !Important;"> >+ <thead> >+ <tr> >+ <th scope="col">Due date</th> >+ <th scope="col">Title</th> >+ <th scope="col">Item type</th> >+ <th scope="col">Checked out on</th> >+ <th scope="col">Checked out from</th> >+ <th scope="col">Call no</th> >+ <th scope="col">Charge</th> >+ <th scope="col">Price</th> >+ <th scope="col">Renew <p class="column-tool"><a href="#" id="CheckAllRenewals">select all</a> | <a href="#" id="UncheckAllRenewals">none</a></p></th> >+ <th scope="col">Check in <p class="column-tool"><a href="#" id="CheckAllCheckins">select all</a> | <a href="#" id="UncheckAllCheckins">none</a></p></th> >+ <th scope="col">Export <p class="column-tool"><a href="#" id="CheckAllExports">select all</a> | <a href="#" id="UncheckAllExports">none</a></p></th> >+ </tr> >+ </thead> >+ [% INCLUDE 'checkouts-table-footer.inc' %] >+ </table> >+ >+ [% IF ( issuecount ) %] >+ <fieldset class="action"> >+ [% IF ( CAN_user_circulate_override_renewals ) %] >+ [% IF ( AllowRenewalLimitOverride ) %] >+ <label for="override_limit">Override renewal limit:</label> >+ <input type="checkbox" name="override_limit" id="override_limit" value="1" /> >+ [% END %] >+ [% END %] >+ <button class="btn" id="RenewCheckinChecked"><i class="icon-check"></i> Renew or return checked items</button> >+ <button class="btn" id="RenewAll"><i class="icon-book"></i> Renew all</button> >+ </fieldset> >+ >+ [% IF ( exports_enabled ) %] >+ <fieldset> >+ <label for="export_formats"><b>Export checkouts using format:</b></label> >+ <select name="export_formats" id="export_formats"> >+ <option value="iso2709_995">ISO2709 with items</option> >+ <option value="iso2709">ISO2709 without items</option> >+ [% IF ( export_with_csv_profile ) %] >+ <option value="csv">CSV</option> >+ [% END %] >+ </select> >+ >+ <label for="export_remove_fields">Don't export fields:</label> <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" /> >+ <input type="hidden" name="op" value="export" /> >+ <input type="hidden" id="export_format" name="format" value="iso2709" /> >+ <input type="hidden" id="dont_export_item" name="dont_export_item" value="0" /> >+ <input type="hidden" id="record_type" name="record_type" value="bibs" /> >+ <button class="btn btn-small" id="export_submit"><i class="icon-download-alt"></i> Export</button> >+ </fieldset> > [% END %] >- [% IF ( issueloo.damaged ) %] >- <span class="dmg">[% issueloo.itemdamaged %]</span> > [% END %] >-</td> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% issueloo.biblionumber %]"><strong>[% issueloo.title |html %][% FOREACH subtitl IN issueloo.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF ( issueloo.author ) %], by [% issueloo.author %][% END %] [% IF ( issueloo.publishercode ) %]; [% issueloo.publishercode %] [% END %] [% IF ( issueloo.publicationyear ) %], [% issueloo.publicationyear %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% issueloo.biblionumber %]&itemnumber=[% issueloo.itemnumber %]#item[% issueloo.itemnumber %]">[% issueloo.barcode %]</a></td> >-<td>[% UNLESS ( noItemTypeImages ) %] [% IF ( issueloo.itemtype_image ) %]<img src="[% issueloo.itemtype_image %]" alt="" />[% END %][% END %][% issueloo.itemtype_description %]</td> >- <td><span title="[% issueloo.issuedate %]">[% issueloo.issuedate | $KohaDates%]</span></td> >- <td>[% issueloo.issuingbranchname %]</td> >- <td>[% issueloo.itemcallnumber %]</td> >- <td>[% issueloo.charge %]</td> >- <td>[% issueloo.replacementprice %]</td> >- [% IF ( issueloo.renew_failed ) %] >- <td class="problem">Renewal Failed</td> >- [% ELSE %] >- <td><span style="padding: 0 1em;">[% IF ( issueloo.renewals ) %][% issueloo.renewals %][% ELSE %]0[% END %]</span> >- [% IF ( issueloo.norenew ) %] >- [% IF ( issueloo.can_confirm ) %]<span class="renewals-allowed" style="display: none"> >- <input type="checkbox" name="all_items[]" value="[% issueloo.itemnumber %]" checked="checked" style="display: none;" /> >- [% IF ( issueloo.od ) %] >- <input type="checkbox" name="items[]" value="[% issueloo.itemnumber %]" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" name="items[]" value="[% issueloo.itemnumber %]" /> >- [% END %] >- </span> >- [% IF issueloo.renewsallowed && issueloo.renewsleft %] >- <span class="renewals">([% issueloo.renewsleft %] of [% issueloo.renewsallowed %] renewals remaining)</span> >- [% END %] >- <span class="renewals-disabled"> >- [% END %] >- [% IF ( issueloo.norenew_reason_on_reserve ) %] >- <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% issueloo.biblionumber %]">On Hold</a> >- [% END %] >- [% IF ( issueloo.norenew_reason_too_many ) %] >- Not renewable >- [% END %] >- [% IF ( issueloo.can_confirm ) %] >- </span> >- [% END %] >- [% ELSE %] >- <input type="checkbox" name="all_items[]" value="[% issueloo.itemnumber %]" checked="checked" style="display: none;" /> >- [% IF ( issueloo.red ) %] >- <input type="checkbox" name="items[]" value="[% issueloo.itemnumber %]" checked="checked" onclick="uncheck_sibling(this);" /> >- [% ELSE %] >- <input type="checkbox" name="items[]" value="[% issueloo.itemnumber %]" onclick="uncheck_sibling(this);" /> >- [% END %] >- [% IF issueloo.renewsallowed && issueloo.renewsleft %] >- <span class="renewals">([% issueloo.renewsleft %] of [% issueloo.renewsallowed %] renewals remaining)</span> >- [% END %] >- [% END %] >- </td> >- [% END %] >- [% IF ( issueloo.return_failed ) %] >- <td class="problem">Check-in failed</td> >- [% ELSE %] >- [% IF ( issueloo.norenew_reason_on_reserve ) %] >- <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% issueloo.biblionumber %]">On hold</a></td> >+ </form> > [% ELSE %] >- <td><input type="checkbox" name="barcodes[]" value="[% issueloo.barcode %]" onclick="uncheck_sibling(this);" /> >- <input type="checkbox" name="all_barcodes[]" value="[% issueloo.barcode %]" checked="checked" style="display: none;" /> >- </td> >- [% END %] >- [% END %] >- </tr> >- [% END %] >- </tbody> >- </table> >- <fieldset class="action"> >- [% IF ( CAN_user_circulate_override_renewals ) %] >- [% IF ( AllowRenewalLimitOverride ) %] >- <label for="override_limit">Override renewal limit:</label> >- <input type="checkbox" name="override_limit" id="override_limit" value="1" /> >- [% END %] >+ <p>Patron has nothing checked out.</p> > [% END %] >- <input type="submit" name="renew_checked" value="Renew or return checked items" /> >- <input type="submit" id="renew_all" name="renew_all" value="Renew all" /> >- </fieldset> >- [% ELSE %]<p>Patron has nothing checked out.</p> >-[% END %] >-</div> >- >+ </div> > >-[% IF relissueloop %] >-<div id="relissues"> >- <table id="relissuest"> >- <thead> >- <tr> >- <th scope="col">Due date</th> >- <th scope="col">Title</th> >- <th scope="col">Item type</th> >- <th scope="col">Checked out on</th> >- <th scope="col">Checked out from</th> >- <th scope="col">Call no.</th> >- <th scope="col">Charge</th> >- <th scope="col">Price</th> >- <th scope="col">Patron</th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH relissueloo IN relissueloop %] >- >- [% IF ( relissueloo.overdue ) %] >- <tr class="problem"> >- [% ELSE %] >- <tr> >- [% END %] >- [% IF ( relissueloo.red ) %] >- <td class="od"> >- [% ELSE %] >- <td> >- [% END %] >- <span title="[% relissueloo.date_due %]">[% relissueloo.date_due | $KohaDates %]</span> >- [% IF ( relissueloo.itemlost ) %] >- <span class="lost">[% relissueloo.itemlost %]</span> >- [% END %] >- [% IF ( relissueloo.damaged ) %] >- <span class="dmg">[% relissueloo.itemdamaged %]</span> >- [% END %] >-</td> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% relissueloo.biblionumber %]"><strong>[% relissueloo.title |html %][% FOREACH subtitl IN relissueloo.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF relissueloo.author %], by [% relissueloo.author %][% END %] [% IF relissueloo.publishercode %]; [% relissueloo.publishercode %] [% END %] [% IF relissueloo.publicationyear %], [% relissueloo.publicationyear %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% relissueloo.biblionumber %]&itemnumber=[% relissueloo.itemnumber %]#item[% relissueloo.itemnumber %]">[% relissueloo.barcode %]</a></td> >-<td>[% UNLESS ( noItemTypeImages ) %] [% IF ( relissueloo.itemtype_image ) %]<img src="[% relissueloo.itemtype_image %]" alt="" />[% END %][% END %][% relissueloo.itemtype_description %]</td> >- <td><span title="[% relissueloo.issuedate %]">[% relissueloo.issuedate | $KohaDates %]</span></td> >- <td>[% relissueloo.issuingbranchname %]</td> >- <td>[% relissueloo.itemcallnumber %]</td> >- <td>[% relissueloo.charge %]</td> >- <td>[% relissueloo.replacementprice %]</td> >- <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% relissueloo.borrowernumber %]">[% relissueloo.firstname %] [% relissueloo.surname %] ([% relissueloo.cardnumber %])</a></td> >- </tr> >- [% END %] >- </tbody> >- </table> >+[% IF ( relatives_issues_count ) %] >+ <div id="relatives-issues"> >+ <table id="relatives-issues-table" style="width: 100% !Important;"> >+ <thead> >+ <tr> >+ <th scope="col">Due date</th> >+ <th scope="col">Title</th> >+ <th scope="col">Item type</th> >+ <th scope="col">Checked out on</th> >+ <th scope="col">Checked out from</th> >+ <th scope="col">Call no</th> >+ <th scope="col">Charge</th> >+ <th scope="col">Price</th> >+ <th scope="col">Patron</th> >+ </tr> >+ </thead> >+ </table> > </div> > [% END %] >- </form> > > <div id="finesandcharges"> > [% IF ( totaldue_raw ) %] >diff --git a/members/moremember.pl b/members/moremember.pl >index adce9d2..5bffe0a 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -2,6 +2,7 @@ > > # Copyright 2000-2002 Katipo Communications > # Copyright 2010 BibLibre >+# Copyright 2014 ByWater Solutions > # > # This file is part of Koha. > # >@@ -52,10 +53,9 @@ use C4::Form::MessagingPreferences; > use List::MoreUtils qw/uniq/; > use C4::Members::Attributes qw(GetBorrowerAttributes); > use Koha::Borrower::Debarments qw(GetDebarments); >-#use Smart::Comments; >-#use Data::Dumper; > use DateTime; > use Koha::DateUtils; >+use Koha::Database; > > use vars qw($debug); > >@@ -68,14 +68,6 @@ my $dbh = C4::Context->dbh; > my $input = CGI->new; > $debug or $debug = $input->param('debug') || 0; > my $print = $input->param('print'); >-my $override_limit = $input->param("override_limit") || 0; >-my @failedrenews = $input->param('failedrenew'); >-my @failedreturns = $input->param('failedreturn'); >-my $error = $input->param('error'); >-my %renew_failed; >-for my $renew (@failedrenews) { $renew_failed{$renew} = 1; } >-my %return_failed; >-for my $failedret (@failedreturns) { $return_failed{$failedret} = 1; } > > my $template_name; > my $quickslip = 0; >@@ -115,8 +107,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > ); > my $borrowernumber = $input->param('borrowernumber'); > >-#start the page and read in includes >-my $data = GetMember( 'borrowernumber' => $borrowernumber ); >+my ( $od, $issue, $fines ) = GetMemberIssuesAndFines($borrowernumber); >+$template->param( issuecount => $issue ); >+ >+my $data = GetMember( 'borrowernumber' => $borrowernumber ); > > if ( not defined $data ) { > $template->param (unknowuser => 1); >@@ -126,8 +120,6 @@ if ( not defined $data ) { > > my $category_type = $data->{'category_type'}; > >-### $category_type >- > $debug and printf STDERR "dates (enrolled,expiry,birthdate) raw: (%s, %s, %s)\n", map {$data->{$_}} qw(dateenrolled dateexpiry dateofbirth); > foreach (qw(dateenrolled dateexpiry dateofbirth)) { > my $userdate = $data->{$_}; >@@ -238,14 +230,11 @@ if ( C4::Context->preference('OPACPrivacy') ) { > $template->param( "privacy".$data->{'privacy'} => 1); > } > >-# current issues >-# >-my @borrowernumbers = GetMemberRelatives($borrowernumber); >-my $issue = GetPendingIssues($borrowernumber); >-my $relissue = []; >-if ( @borrowernumbers ) { >- $relissue = GetPendingIssues(@borrowernumbers); >-} >+my @relatives = GetMemberRelatives($borrowernumber); >+my $relatives_issues_count = >+ Koha::Database->new()->schema()->resultset('Issue') >+ ->count( { borrowernumber => \@relatives } ); >+ > my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} ); > my $today = DateTime->now( time_zone => C4::Context->tz); > $today->truncate(to => 'day'); >@@ -253,10 +242,6 @@ my @borrowers_with_issues; > my $overdues_exist = 0; > my $totalprice = 0; > >-my @issuedata = build_issue_data($issue); >-my @relissuedata = build_issue_data($relissue); >- >- > ### ############################################################################### > # BUILD HTML > # show all reserves of this borrower, and the position of the reservation .... >@@ -422,13 +407,9 @@ $template->param( > totalprice => sprintf("%.2f", $totalprice), > totaldue => sprintf("%.2f", $total), > totaldue_raw => $total, >- issueloop => @issuedata, >- relissueloop => @relissuedata, > overdues_exist => $overdues_exist, >- error => $error, > StaffMember => ($category_type eq 'S'), > is_child => ($category_type eq 'C'), >-# reserveloop => \@reservedata, > samebranch => $samebranch, > quickslip => $quickslip, > activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), >@@ -436,92 +417,8 @@ $template->param( > SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'), > RoutingSerials => C4::Context->preference('RoutingSerials'), > debarments => GetDebarments({ borrowernumber => $borrowernumber }), >+ relatives_issues_count => $relatives_issues_count, >+ relatives_borrowernumbers => \@relatives, > ); >-$template->param( $error => 1 ) if $error; > > output_html_with_http_headers $input, $cookie, $template->output; >- >-sub build_issue_data { >- my $issues = shift; >- >- my $localissue; >- >- foreach my $issue ( @{$issues} ) { >- >- # Getting borrower details >- my $memberdetails = GetMemberDetails( $issue->{borrowernumber} ); >- $issue->{borrowername} = >- $memberdetails->{firstname} . ' ' . $memberdetails->{surname}; >- $issue->{cardnumber} = $memberdetails->{cardnumber}; >- my $issuedate; >- if ($issue->{issuedate} ) { >- $issuedate = $issue->{issuedate}->clone(); >- } >- $issue->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($issue->{biblionumber}), GetFrameworkCode($issue->{biblionumber})); >- $issue->{issuingbranchname} = GetBranchName($issue->{branchcode}); >- my %row = %{$issue}; >- $totalprice += $issue->{replacementprice}; >- >- # item lost, damaged loops >- if ( $row{'itemlost'} ) { >- my $fw = GetFrameworkCode( $issue->{biblionumber} ); >- my $category = GetAuthValCode( 'items.itemlost', $fw ); >- my $lostdbh = C4::Context->dbh; >- my $sth = $lostdbh->prepare( >-"select lib from authorised_values where category=? and authorised_value =? " >- ); >- $sth->execute( $category, $row{'itemlost'} ); >- my $loststat = $sth->fetchrow; >- if ($loststat) { >- $row{'itemlost'} = $loststat; >- } >- } >- if ( $row{'damaged'} ) { >- my $fw = GetFrameworkCode( $issue->{biblionumber} ); >- my $category = GetAuthValCode( 'items.damaged', $fw ); >- my $damageddbh = C4::Context->dbh; >- my $sth = $damageddbh->prepare( >-"select lib from authorised_values where category=? and authorised_value =? " >- ); >- $sth->execute( $category, $row{'damaged'} ); >- my $damagedstat = $sth->fetchrow; >- if ($damagedstat) { >- $row{'itemdamaged'} = $damagedstat; >- } >- } >- >- # end lost, damaged >- if ( $issue->{overdue} ) { >- $overdues_exist = 1; >- $row{red} = 1; >- } >- if ($issuedate) { >- $issuedate->truncate( to => 'day' ); >- if ( DateTime->compare( $issuedate, $today ) == 0 ) { >- $row{today} = 1; >- } >- } >- >- #find the charge for an item >- my ( $charge, $itemtype ) = >- GetIssuingCharges( $issue->{itemnumber}, $borrowernumber ); >- >- my $itemtypeinfo = getitemtypeinfo($itemtype); >- $row{'itemtype_description'} = $itemtypeinfo->{description}; >- $row{'itemtype_image'} = $itemtypeinfo->{imageurl}; >- >- $row{'charge'} = sprintf( "%.2f", $charge ); >- >- my ( $renewokay, $renewerror ) = >- CanBookBeRenewed( $borrowernumber, $issue->{itemnumber}, >- $override_limit ); >- $row{'norenew'} = !$renewokay; >- $row{'can_confirm'} = ( !$renewokay && $renewerror ne 'on_reserve' ); >- $row{"norenew_reason_$renewerror"} = 1 if $renewerror; >- $row{renew_failed} = $renew_failed{ $issue->{itemnumber} }; >- $row{return_failed} = $return_failed{ $issue->{barcode} }; >- ($row{'renewcount'},$row{'renewsallowed'},$row{'renewsleft'}) = C4::Circulation::GetRenewCount($issue->{'borrowernumber'},$issue->{'itemnumber'}); #Add renewal count to item data display >- push( @{$localissue}, \%row ); >- } >- return $localissue; >-} >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11703
:
25105
|
25110
|
25111
|
25213
|
25217
|
25218
|
25220
|
25221
|
25261
|
25262
|
25263
|
25264
|
25271
|
25272
|
25289
|
25290
|
25292
|
25390
|
25391
|
25986
|
25987
|
25988
|
25989
|
25990
|
25991
|
25992
|
25993
|
25994
|
25995
|
25996
|
25997
|
25998
|
25999
|
26081
|
26085
|
26115
|
26131
|
26158
|
26160
|
26241
|
26986
|
26990
|
26991
|
27102
|
27241
|
27338
|
27339
|
27340
|
27341
|
27342
|
27349
|
27350
|
27353
|
27354
|
27356
|
27548
|
27610
|
27717
|
27718
|
27745
|
27746
|
27750
|
27751
|
28025
|
28026
|
28027
|
28028
|
28029
|
29195
|
29196
|
29197
|
29198
|
29199
|
29279
|
29280
|
29281
|
29282
|
29283
|
29284
|
29419
|
29420
|
29432
|
29433
|
29434
|
29438
|
29439
|
29440
|
29444
|
29445
|
29446
|
29447
|
29448
|
29449
|
29450
|
29451
|
29452
|
29453
|
29454
|
29472
|
29473
|
29474
|
29475
|
29476
|
29477
|
29478
|
29479
|
29480
|
29493
|
30228