Bugzilla – Attachment 27341 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 [QA Followup] - Retain functionality of IssuesDefaultSortOrder system preferences
Bug-11703-QA-Followup---Retain-functionality-of-Is.patch (text/plain), 6.36 KB, created by
Kyle M Hall (khall)
on 2014-04-21 11:38:37 UTC
(
hide
)
Description:
Bug 11703 [QA Followup] - Retain functionality of IssuesDefaultSortOrder system preferences
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-04-21 11:38:37 UTC
Size:
6.36 KB
patch
obsolete
>From 4bfe33d2c5f608132a39b8c2075d2932a37ad244 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 21 Apr 2014 07:33:33 -0400 >Subject: [PATCH] Bug 11703 [QA Followup] - Retain functionality of IssuesDefaultSortOrder system preferences > >--- > koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 3 +- > svc/checkouts.pl | 105 +++++++++++++---------- > 2 files changed, 61 insertions(+), 47 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >index 01098c9..8dafc3f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >@@ -129,11 +129,10 @@ $(document).ready(function() { > issuesTable = $("#issues-table").dataTable({ > "bAutoWidth": false, > "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t", >- "aaSorting": [[ 0, "desc" ]], > "aoColumns": [ > { > "mDataProp": function( oObj ) { >- if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) { >+ if ( oObj.issued_today ) { > return "<strong>" + TODAYS_CHECKOUTS + "</strong>"; > } else { > return "<strong>" + PREVIOUS_CHECKOUTS + "</strong>"; >diff --git a/svc/checkouts.pl b/svc/checkouts.pl >index ed4d0ff..bdf186a 100755 >--- a/svc/checkouts.pl >+++ b/svc/checkouts.pl >@@ -81,7 +81,9 @@ my $sql = ' > borrowernumber, > surname, > firstname, >- cardnumber >+ cardnumber, >+ >+ DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today > FROM issues > LEFT JOIN items USING ( itemnumber ) > LEFT JOIN biblio USING ( biblionumber ) >@@ -107,7 +109,8 @@ $sth->execute(@parameters); > > my $item_level_itypes = C4::Context->preference('item-level_itypes'); > >-my @checkouts; >+my @checkouts_today; >+my @checkouts_previous; > while ( my $c = $sth->fetchrow_hashref() ) { > my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} ); > >@@ -116,52 +119,64 @@ while ( my $c = $sth->fetchrow_hashref() ) { > > my ( $renewals_count, $renewals_allowed, $renewals_remaining ) = > GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); >- push( >- @checkouts, >- { >- DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, >- title => $c->{title}, >- author => $c->{author}, >- barcode => $c->{barcode}, >- itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, >- itemnotes => $c->{itemnotes}, >- branchcode => $c->{branchcode}, >- branchname => $c->{branchname}, >- itemcallnumber => $c->{itemcallnumber} || q{}, >- charge => $charge, >- price => $c->{replacementprice} || q{}, >- can_renew => $can_renew, >- can_renew_error => $can_renew_error, >- itemnumber => $c->{itemnumber}, >- borrowernumber => $c->{borrowernumber}, >- biblionumber => $c->{biblionumber}, >- issuedate => $c->{issuedate}, >- date_due => $c->{date_due}, >- renewals_count => $renewals_count, >- renewals_allowed => $renewals_allowed, >- renewals_remaining => $renewals_remaining, >- issuedate_formatted => >- output_pref( dt_from_string( $c->{issuedate} ) ), >- date_due_formatted => output_pref( >- { >- dt => dt_from_string( $c->{date_due} ), >- as_due_date => 1 >- } >- ), >- subtitle => GetRecordValue( >- 'subtitle', >- GetMarcBiblio( $c->{biblionumber} ), >- GetFrameworkCode( $c->{biblionumber} ) >- ), >- borrower => { >- surname => $c->{surname}, >- firstname => $c->{firstname}, >- cardnumber => $c->{cardnumber}, >+ >+ my $checkout = { >+ DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, >+ title => $c->{title}, >+ author => $c->{author}, >+ barcode => $c->{barcode}, >+ itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, >+ itemnotes => $c->{itemnotes}, >+ branchcode => $c->{branchcode}, >+ branchname => $c->{branchname}, >+ itemcallnumber => $c->{itemcallnumber} || q{}, >+ charge => $charge, >+ price => $c->{replacementprice} || q{}, >+ can_renew => $can_renew, >+ can_renew_error => $can_renew_error, >+ itemnumber => $c->{itemnumber}, >+ borrowernumber => $c->{borrowernumber}, >+ biblionumber => $c->{biblionumber}, >+ issuedate => $c->{issuedate}, >+ date_due => $c->{date_due}, >+ renewals_count => $renewals_count, >+ renewals_allowed => $renewals_allowed, >+ renewals_remaining => $renewals_remaining, >+ issuedate_formatted => output_pref( dt_from_string( $c->{issuedate} ) ), >+ date_due_formatted => output_pref( >+ { >+ dt => dt_from_string( $c->{date_due} ), >+ as_due_date => 1 > } >- } >- ); >+ ), >+ subtitle => GetRecordValue( >+ 'subtitle', >+ GetMarcBiblio( $c->{biblionumber} ), >+ GetFrameworkCode( $c->{biblionumber} ) >+ ), >+ borrower => { >+ surname => $c->{surname}, >+ firstname => $c->{firstname}, >+ cardnumber => $c->{cardnumber}, >+ }, >+ issued_today => !$c->{not_issued_today}, >+ }; >+ >+ if ( $c->{not_issued_today} ) { >+ push( @checkouts_previous, $checkout ); >+ } >+ else { >+ push( @checkouts_today, $checkout ); >+ } > } > >+@checkouts_today = reverse(@checkouts_today) >+ if ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' ); >+@checkouts_previous = reverse(@checkouts_previous) >+ if ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' ); >+ >+my @checkouts = ( @checkouts_today, @checkouts_previous ); >+ > my $data; > $data->{'iTotalRecords'} = scalar @checkouts; #FIXME > $data->{'iTotalDisplayRecords'} = scalar @checkouts; >-- >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