Bugzilla – Attachment 76029 Details for
Bug 17698
Make patron notes show up on staff dashboard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17698: (follow-up) Changing to Koha Objects style, adding circ sidebar
Bug-17698-follow-up-Changing-to-Koha-Objects-style.patch (text/plain), 16.49 KB, created by
Jonathan Druart
on 2018-06-13 15:23:54 UTC
(
hide
)
Description:
Bug 17698: (follow-up) Changing to Koha Objects style, adding circ sidebar
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-06-13 15:23:54 UTC
Size:
16.49 KB
patch
obsolete
>From d725552df2c33e47b888cc0c7347b842dcc9ed71 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 26 Jun 2017 23:31:17 +0000 >Subject: [PATCH] Bug 17698: (follow-up) Changing to Koha Objects style, adding > circ sidebar > >Marcel, can you please have a look at this patch. I tried to implement >the change >my @notes = $schema->resultset('Issue')->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] }); >to >my @notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] }); >but am having problems on the template side. I can access the item and >biblio information about the issue, but not the borrower information, >even though the query is definitely pulling it correctly. Any >suggestions or ideas as to why this breaks? > >This patch also adds the implementation of the circSidebar. > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > circ/branchoverdues.pl | 4 +++ > circ/checkout-notes.pl | 8 +++-- > circ/circulation.pl | 4 +++ > circ/on-site_checkouts.pl | 4 ++- > circ/renew.pl | 4 +++ > circ/returns.pl | 4 +++ > circ/selectbranchprinter.pl | 4 +++ > circ/transferstoreceive.pl | 8 +++-- > circ/view_holdsqueue.pl | 5 ++- > circ/waitingreserves.pl | 5 +++ > .../intranet-tmpl/prog/en/includes/circ-nav.inc | 3 ++ > .../prog/en/modules/circ/checkout-notes.tt | 42 ++++++++++++++-------- > 12 files changed, 74 insertions(+), 21 deletions(-) > >diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl >index d4c20cbb18..ed4b85522d 100755 >--- a/circ/branchoverdues.pl >+++ b/circ/branchoverdues.pl >@@ -27,6 +27,7 @@ use C4::Koha; > use C4::Debug; > use Koha::DateUtils; > use Koha::BiblioFrameworks; >+use Koha::Checkouts; > use Data::Dumper; > > =head1 branchoverdues.pl >@@ -98,10 +99,13 @@ foreach my $num (@getoverdues) { > push( @overduesloop, \%overdueforbranch ); > } > >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+ > # initiate the templates for the overdueloop > $template->param( > overduesloop => \@overduesloop, > location => $location, >+ pending_checkout_notes => $pending_checkout_notes, > ); > > # Checking if there is a Fast Cataloging Framework >diff --git a/circ/checkout-notes.pl b/circ/checkout-notes.pl >index ceb52c953e..b0638f4525 100755 >--- a/circ/checkout-notes.pl >+++ b/circ/checkout-notes.pl >@@ -37,10 +37,12 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >-my $schema = Koha::Database->new()->schema(); >-my @notes = $schema->resultset('Issue')->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] }); >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+my @notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] }); >+ > $template->param( >- notes => \@notes, >+ pending_checkout_notes => $pending_checkout_notes, >+ notes => \@notes, > ); > > my $action; >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 1617584cf4..e0de5d0994 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -56,6 +56,7 @@ use Koha::Patron::Messages; > use Koha::SearchEngine; > use Koha::SearchEngine::Search; > use Koha::Patron::Modifications; >+use Koha::Checkouts; > > use Date::Calc qw( > Today >@@ -145,6 +146,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( > ); > my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; > >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+$template->param( pending_checkout_notes => $pending_checkout_notes ); >+ > my $force_allow_issue = $query->param('forceallow') || 0; > if (!C4::Auth::haspermission( C4::Context->userenv->{id} , { circulate => 'force_checkout' } )) { > $force_allow_issue = 0; >diff --git a/circ/on-site_checkouts.pl b/circ/on-site_checkouts.pl >index aac5e79064..bcf78cc5b5 100755 >--- a/circ/on-site_checkouts.pl >+++ b/circ/on-site_checkouts.pl >@@ -23,6 +23,7 @@ use C4::Circulation qw( GetPendingOnSiteCheckouts ); > use C4::Output; > use C4::Koha; > use Koha::BiblioFrameworks; >+use Koha::Checkouts; > > my $cgi = new CGI; > >@@ -39,11 +40,12 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >- >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; > my $pending_onsite_checkouts = C4::Circulation::GetPendingOnSiteCheckouts(); > > $template->param( > pending_onsite_checkouts => $pending_onsite_checkouts, >+ pending_onsite_notes => $pending_onsite_notes, > ); > > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/circ/renew.pl b/circ/renew.pl >index 246c26629f..01c37cd048 100755 >--- a/circ/renew.pl >+++ b/circ/renew.pl >@@ -28,6 +28,7 @@ use C4::Koha; > use Koha::DateUtils; > use Koha::Database; > use Koha::BiblioFrameworks; >+use Koha::Checkouts; > > my $cgi = new CGI; > >@@ -121,4 +122,7 @@ if ($barcode) { > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+$template->param( pending_checkout_notes => $pending_checkout_notes ); >+ > output_html_with_http_headers( $cgi, $cookie, $template->output ); >diff --git a/circ/returns.pl b/circ/returns.pl >index a82bdc1432..103d290fb3 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -52,6 +52,7 @@ use Koha::BiblioFrameworks; > use Koha::Holds; > use Koha::Items; > use Koha::Patrons; >+use Koha::Checkouts; > > my $query = new CGI; > >@@ -579,6 +580,8 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { > push @riloop, \%ri; > } > >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+ > $template->param( > riloop => \@riloop, > printer => $printer, >@@ -589,6 +592,7 @@ $template->param( > forgivemanualholdsexpire => $forgivemanualholdsexpire, > overduecharges => $overduecharges, > AudioAlerts => C4::Context->preference("AudioAlerts"), >+ pending_checkout_notes => $pending_checkout_notes, > ); > > $itemnumber = GetItemnumberFromBarcode( $barcode ); >diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl >index 03fa65b1ec..935cb4e7ee 100755 >--- a/circ/selectbranchprinter.pl >+++ b/circ/selectbranchprinter.pl >@@ -27,6 +27,7 @@ use C4::Print; # GetPrinters > use C4::Koha; > use Koha::BiblioFrameworks; > use Koha::Libraries; >+use Koha::Checkouts; > > # this will be the script that chooses branch and printer settings.... > >@@ -126,11 +127,14 @@ if (scalar @updated and not scalar @recycle_loop) { > print $query->redirect($referer || '/cgi-bin/koha/circ/circulation.pl'); > } > >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+ > $template->param( > referer => $referer, > printerloop => \@printerloop, > branch => $branch, > recycle_loop=> \@recycle_loop, >+ pending_checkout_notes => $pending_checkout_notes, > ); > > # Checking if there is a Fast Cataloging Framework >diff --git a/circ/transferstoreceive.pl b/circ/transferstoreceive.pl >index 10df07df07..cf43499866 100755 >--- a/circ/transferstoreceive.pl >+++ b/circ/transferstoreceive.pl >@@ -40,6 +40,7 @@ use Koha::Libraries; > use Koha::DateUtils; > use Koha::BiblioFrameworks; > use Koha::Patrons; >+use Koha::Checkouts; > > my $input = new CGI; > my $itemnumber = $input->param('itemnumber'); >@@ -125,11 +126,14 @@ while ( my $library = $libraries->next ) { > push( @branchesloop, \%branchloop ) if %branchloop; > } > >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+ > $template->param( > branchesloop => \@branchesloop, > show_date => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), >- TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'), >- latetransfers => $latetransfers ? 1 : 0, >+ TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'), >+ latetransfers => $latetransfers ? 1 : 0, >+ pending_checkout_notes => $pending_checkout_notes, > ); > > # Checking if there is a Fast Cataloging Framework >diff --git a/circ/view_holdsqueue.pl b/circ/view_holdsqueue.pl >index 6c0fcd6db7..d471476c4d 100755 >--- a/circ/view_holdsqueue.pl >+++ b/circ/view_holdsqueue.pl >@@ -30,7 +30,7 @@ use C4::Biblio; > use C4::Items; > use C4::HoldsQueue qw(GetHoldsQueueItems); > use Koha::BiblioFrameworks; >- >+use Koha::Checkouts; > use Koha::ItemTypes; > > my $query = new CGI; >@@ -64,6 +64,9 @@ if ( $run_report ) { > ); > } > >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+$template->param( pending_checkout_notes => $pending_checkout_notes ); >+ > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index 5943ea5673..93ca0e9590 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -39,6 +39,7 @@ use Koha::BiblioFrameworks; > use Koha::Items; > use Koha::ItemTypes; > use Koha::Patrons; >+use Koha::Checkouts; > > my $input = new CGI; > >@@ -149,6 +150,9 @@ while ( my $hold = $holds->next ) { > } > > $template->param(cancel_result => \@cancel_result) if @cancel_result; >+ >+my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; >+ > $template->param( > reserveloop => \@reservloop, > reservecount => $reservcount, >@@ -157,6 +161,7 @@ $template->param( > show_date => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), > ReservesMaxPickUpDelay => $max_pickup_delay, > tab => $tab, >+ pending_checkout_notes => $pending_checkout_notes, > ); > > # Checking if there is a Fast Cataloging Framework >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >index 844926c83a..b4ac72c3d9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >@@ -33,6 +33,9 @@ > [% IF ( fast_cataloging ) %][% IF ( CAN_user_editcatalogue_fast_cataloging ) %] > <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a></li> > [% END %][% END %] >+ [% IF Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes %] >+ <li><a href="/cgi-bin/koha/circ/checkout-notes.pl">Checkout notes</a> [% IF pending_checkout_notes %]<span class="number_box"><a href="/cgi-bin/koha/circ/checkout-notes.pl">[% pending_checkout_notes %]</span>[% END %]</li> >+ [% END %] > </ul> > > <h5>Circulation reports</h5> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt >index 2fb1ec8593..aa44abe6de 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt >@@ -83,9 +83,10 @@ > Checkout notes > </div> > >-<div id="doc" class="yui-t7"> <!-- <div id="doc3" class="yui-t2" --> >+[% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc" class="yui-t7">[% END %] > <div id="bd"> > <div id="yui-main"> >+ [% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %] > > <h1>Checkout notes</h1> > >@@ -127,20 +128,24 @@ > [% FOREACH note IN notes %] > <tr> > <td><input type="checkbox" name="issue_ids" value="[% note.issue_id %]"></td> >- <td>[% note.item.biblionumber.title %] - [% note.item.biblionumber.author %] (<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% note.item.biblionumber.biblionumber %]">[% note.item.barcode %]</a>)</td> >+ <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>[% note.borrower.firstname %] [% note.borrower.surname %] (<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% note.borrower.borrowernumber %]">[% note.borrower.cardnumber %]</a>)</td> >- <td>[% IF ( note.noteseen == 0 ) %] >- <span id="status_[% note.issue_id %]">Not seen</span> >- [% ELSIF ( note.noteseen == 1 ) %] >- <span id="status_[% note.issue_id %]">Seen</span> >- [% END %]</td> >- <td class="actions">[% IF ( note.noteseen == 1 ) %] >- <button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs"><i class="fa fa-eye-slash"></i> Mark not seen</button> >- [% ELSIF ( note.noteseen == 0 ) %] >- <button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button> >- [% END %]</td> >+ <td>[% IF note.borrower.title %][% note.borrower.title [% END %][% note.borrower.firstname %] [% note.borrower.surname %] (<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% note.borrower.borrowernumber %]">[% note.borrower.cardnumber %]</a>)</td> >+ <td> >+ [% IF ( note.noteseen == 0 ) %] >+ <span id="status_[% note.issue_id %]">Not seen</span> >+ [% ELSIF ( note.noteseen == 1 ) %] >+ <span id="status_[% note.issue_id %]">Seen</span> >+ [% END %] >+ </td> >+ <td class="actions"> >+ [% IF ( note.noteseen == 1 ) %] >+ <button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs"><i class="fa fa-eye-slash"></i> Mark not seen</button> >+ [% ELSIF ( note.noteseen == 0 ) %] >+ <button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button> >+ [% END %] >+ </td> > </tr> > [% END %] > </tbody> >@@ -157,7 +162,16 @@ > > [% END %] <!-- selected_count --> > >- </div> <!-- yui-main --> >+ </div> <!-- yui-imain --> >+ >+ [% IF Koha.Preference('CircSidebar') %] >+ </div> >+ >+ <div class="yui-b noprint"> >+ [% INCLUDE 'circ-nav.inc' %] >+ </div> >+ [% END %] >+ > </div> <!-- bd --> > </div> <!-- doc3 --> > >-- >2.11.0
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 17698
:
57851
|
58779
|
58780
|
58786
|
59480
|
59638
|
59762
|
59778
|
59809
|
59828
|
59829
|
59957
|
61857
|
62337
|
62351
|
64662
|
64683
|
64835
|
71100
|
71126
|
71127
|
72875
|
72876
|
72877
|
73004
|
73005
|
73006
|
73839
|
73840
|
73841
|
74044
|
74193
|
75837
|
75838
|
75839
|
75840
|
75841
|
75842
|
76011
|
76012
|
76028
| 76029 |
76030
|
76031
|
76032
|
76033
|
76034
|
76035
|
76036
|
76037
|
89964
|
90037